PDA

View Full Version : Examining a core dump via gdb


link1305
07-11-2007, 09:34 PM
Hello,

Is it possible to examine a core dump from srcds using gdb (the debugging tool on linux)? I read somewhere else that it is, but gdb won't read the file:
"/servers/source/core.6691" is not a core dump: File format not recognized :o

For those interested:

The problem I have only exists on linux....it runs without issue on windows (how often can you say that? ;)). When my server mod reads a certain line in its config file, the server seg faults. The line it reads isn't very different from any other Convar I've created either - all it does is call the "SetValue()" function of a variable of type ConVar. I have about 20 convars total, and only 4 of them cause it to seg fault. Very strange problem.

Any thoughts?

Ging
07-12-2007, 08:11 AM
it runs without issue on windows (how often can you say that? ;)).

All the time, especially when talking about HL2 mod binaries.

You should be able to debug using cores - or you could run srcds through gdb directly and skip over the need for the core file.

link1305
07-12-2007, 08:28 PM
Okay, I'm debugging with gdb just by running the executable through it. After srcds crashes I can view the stack with "frame", but thats not very helpful (since I already know which function it's crashing in). I would like to view a variable, but print <variable> says "no symbol in current context". Any tips for debugging srcds mods using gdb?

The last output is 0xb1dfe003 in Cplugin::SetVar () <mod file.so> I know it crashes while executing a statement in that function (the statement is convarVariable->SetValue(1)), but while it's executing that statement I'd like to see more information about the "convarVariable" - is that possible?

Thanks!

link1305
07-12-2007, 09:52 PM
Nevermind about that last part...after recompiling and running it again, it's displaying my variables. Still stumped :/