Changes between Version 1 and Version 2 of Debugging
- Timestamp:
- Sep 13, 2013, 8:15:09 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Debugging
v1 v2 13 13 * [http://www.microsoft.com/visualstudio Visual Studio] - the basic tool for debugging the game on Windows. Break into the debugger on a breakpoint, on a crash or assertion failure, or any other time. Visual C++ Express is free and contains similar debugging features. Can be used to analyze crash dumps and get a useful call stack. 14 14 * [http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx WinDbg] - part of the Windows SDK, a very powerful debugging suite which is primarily command line driven, unlike Visual Studio. Analyze crashes in more detail than VS. 15 * [http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx DebugView] - If you don't run the process in a debugger, !DebugView lets you view its normally hidden debug output. 16 * [http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx VMMap] - Free tool from Microsoft to analyze the virtual memory usage of a process; shows fragmentation, can be useful for observing memory leaks or 15 * [http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx DebugView] - If you don't run the process in a debugger, !DebugView lets you view its normally hidden debug output. Users can install and run this much more easily than a full debugging suite. 16 * [http://technet.microsoft.com/en-us/sysinternals/dd535533.aspx VMMap] - Free tool from Microsoft to analyze the virtual memory usage of a process; shows fragmentation, can be useful for observing memory leaks or finding why a large allocation fails. 17 17 * [http://www.gremedy.com/ gDEBugger] - Debug and profile OpenGL applications. Useful for debugging GL errors and finding unexpected behavior. 18 18 * [http://notepad-plus-plus.org/ Notepad++] - small, simple, powerful text editor. You need a decent text editor on Windows. 19 19 * A hex editor, like [http://home.gna.org/bless/ Bless] - useful for examining binary simulation state dumps, either for saved games or serialization errors. 20 21 TODO: I know there are more... 20 22 21 23 === Linux === … … 28 30 === OS X === 29 31 30 * [https://developer.apple.com/xcode/ Xcode] - free IDE for development on OS X, also has suite of debugging tools 32 * [https://developer.apple.com/xcode/ Xcode] - free IDE for development on OS X, also has suite of debugging tools. 31 33 * gdb 32 34 33 35 == Debugging Crashes == 34 36 35 You want two things when debugging crashes: 1) steps to reproduce, 2) a call stack (i.e. back trace).37 You want two things when debugging crashes: 1) steps to reproduce, and 2) a call stack (i.e. back trace). 36 38 37 39 === Reproducing the crash === 38 40 39 41 Important info to gather: 40 * Build environment - custom build, SVN autobuild, or release package? Which compiler ?42 * Build environment - custom build, SVN autobuild, or release package? Which compiler version? 41 43 * Hardware (e.g. `system_info.txt`) 42 44 * Operating system (e.g. `system.info.txt`) … … 46 48 * What are the minimal steps to get the crash? Is it consistent? 47 49 48 There are many different causes of crashes (running out of memory, heap corruption, invalid pointers or iterators, buggy drivers - to name only a few). Sometimes they are only reproducible with one OS, one type of GPU drivers, one version of a compiler, one type of CPU, or only after following a complex series of steps. Collecting the above information can point you in the right direction.50 There are many different causes of crashes (running out of memory, heap corruption, invalid pointers or iterators, buggy drivers - to name only a few). Sometimes they are only reproducible with one OS, one type of GPU drivers, one version of a compiler, one type of CPU, or only after following a complex series of steps. Collecting the above information can point you and others in the right direction. 49 51 50 Sometimes, but not always, when the game crashes it will create a `crashlog.txt` in the log directory (see GameDataPaths). This file contains basic system info and often a call stack. On windows, a `crashlog.dmp` may also be created.52 Sometimes, but not always, when the game crashes it will create a `crashlog.txt` in the log directory (see GameDataPaths). This file contains basic system info and often a call stack. On Windows, a `crashlog.dmp` may also be created, from which a call stack can be obtained. 51 53 52 54 === Call stack on Windows ===