MudBytes
» MUDBytes Community » Language Discussions » C and C++ » Troubles with gdb and freopen
Pages: << prev 1 next >>
Troubles with gdb and freopen
Keberus
Magician






Group: Members
Posts: 90
Joined: May 18, 2006

Go to the bottom of the page Go to the top of the page
#1 id:44138 Posted Mar 17, 2010, 4:32 pm

Okay, I decided to change the way I rename my log files, before I updated the stderr right before the copyover/hotboot. Kayle threw out an idea that it could be done in db.c, which I thought was cool, because for me the first log file name of a new startup would never be correct. Well, call freopen on the stderr and it works fine, but when I run my MUD in gdb I don't see the output. So my questions is/are is there a way to make GDB recognize the new stderr stream? If not, then is there a way to make my game recognize the fact that I'm running it in GDB? I would like a way to do it so I wouldn't have to change anything code wise to run in GDB vs running it normally, if not that's cool though.

Thanks for any input,
KeB
.........................
Keberus Maou'San
Co-Owner/Coder - Star Wars: The Galactic Alliance
Co-Owner/Coder - Severed Realms (not yet open)

www.t-n-k-games.com

"Reality is merely an illusion, albeit a very persistent one." -Albert Einstein

Hygelac
Fledgling




Group: Members
Posts: 3
Joined: Mar 22, 2010

Go to the bottom of the page Go to the top of the page
#2 id:44977 Posted Apr 7, 2010, 10:15 pm

within gdb do
run port > error_file_name

You may also find this GDB Reference helpful.
.........................
- Hygelac
----
The Legends of Xenobia at telnet://xenobia.mudmagic.com:1972

Last edited Apr 7, 2010, 10:27 pm by Hygelac
Pages:<< prev 1 next >>

Valid XHTML 1.1! Valid CSS!