Log in

View Full Version : Debugging with stack trace


jsr
05-05-2013, 06:10 AM
Took me a while to find this, it would be great if someone could sticky it.



You most likely want to add debugging information to the release version if that is what is crashing. If zone.exe is all that's crashing then that's what you should focus on.

Open the solution in Visual Studio.
Select Release or ReleaseBots in the dropdown at the top.
Right-click zone in the solution window and select properties.
In the property pages, find C/C++ and change Debug Information Format to Program Database (/Zi)
Under Linker/Debugging change Generate Debug Info to Yes (/DEBUG)
Compile
Copy all of the normal executables to your server directory along with zone.pdb


From here it depends on how you can duplicate the problem.

If it is easy to reproduce then start the server and get your toon that can cause the crash to the zone. Look in the logs folder to find what the process ID is for the zone you are in. It's the number in the log file name. In Visual Studio select Debug->Attach to Process and find the zone.exe that has the same number as the log file. Make it crash, copy the call stack from Visual Studio and post it if you can't figure it out yourself.

If it is not easy to reproduce then you will probably have better results with a minidump. Secrets posted information on how to force those to be generated by crashes. You open them in Visual Studio, click the green arrow, and it will show you where the crash occured.



From: http://www.eqemulator.org/forums/showthread.php?p=204137#post204137

lerxst2112
05-05-2013, 01:17 PM
If you choose the RelWithDebInfo build type in CMake (There's not really a good reason not to) then all of the debugging info will be added automatically. You just need to compile and remember to copy the pdb files with the executables to the directory where you run the server. Then if you have a crash a stack trace will be dumped to the log file.

The debugger is still handy to see a little more info, but usually with the trace from the log as well as the steps that caused the crash if you know them it can be narrowed down.