Changes between Version 23 and Version 24 of Debugging
- Timestamp:
- Feb 18, 2024, 1:04:01 PM (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Debugging
v23 v24 8 8 9 9 === Windows === 10 * [https://visualstudio.microsoft.com/ 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 Studio Community Edition is free and contains similar debugging features. Can be used to analyze crash dumps and get a useful call stack.11 * [https://developer.microsoft.com/en-us/windows/downloads/sdk-archive 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.10 * [https://visualstudio.microsoft.com/ 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 Studio Community Edition is free and contains similar debugging features. Can be used to analyze crash dumps and get a useful call stack. 11 * [https://developer.microsoft.com/en-us/windows/downloads/sdk-archive 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. 12 12 * [https://docs.microsoft.com/en-us/sysinternals/downloads/debugview 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. 13 13 * [https://docs.microsoft.com/en-us/sysinternals/downloads/vmmap 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. 14 14 * [https://www.khronos.org/opengl/wiki/Debugging_Tools OpenGL Debugger] - Debug and profile OpenGL applications. Useful for debugging GL errors and finding unexpected behavior. 15 * [http://notepad-plus-plus.org/ Notepad++] - small, simple, powerful text editor. You need a decent text editor on Windows.16 * A hex editor, like [https://github.com/afrantzis/bless Bless] - useful for examining binary simulation state dumps, either for saved games or serialization errors.17 * [https://www.virtualbox.org/ VirtualBox] - virtual machines are very convenient for testing the game on other operating systems, or for testing multiplayer games locally. VBox is FOSS and works quite well.18 * [https://github.com/lucasg/Dependencies/ Dependencies] - replacement for Dependency Walker, which allows viewing linked DLLs and symbols for Windows binaries. Very useful for troubleshooting missing DLLs and symbols, and verifying the game isn't depending on old VC runtime libraries.15 * [http://notepad-plus-plus.org/ Notepad++] - Small, simple, powerful text editor. You need a decent text editor on Windows. 16 * A hex editor, like [https://github.com/afrantzis/bless Bless] - Useful for examining binary simulation state dumps, either for saved games or serialization errors. 17 * [https://www.virtualbox.org/ VirtualBox] - Virtual machines are very convenient for testing the game on other operating systems, or for testing multiplayer games locally. VBox is FOSS and works quite well. 18 * [https://github.com/lucasg/Dependencies/ Dependencies] - Replacement for Dependency Walker, which allows viewing linked DLLs and symbols for Windows binaries. Very useful for troubleshooting missing DLLs and symbols, and verifying the game isn't depending on old VC runtime libraries. 19 19 20 20 TODO: I know there are more... 21 21 22 22 === Linux === 23 * [https://www.gnu.org/software/gdb/ gdb] - the basic tool for debugging in the GNU toolchain. gdb lets you e.g. break into the engine on a breakpoint or when a seg fault or assertion failure occurs. You can start your process in gdb or attach gdb to a running process.24 * [http://valgrind.org/ valgrind] - debugging and profiling suite. Find memory leaks, invalid memory accesses and more.23 * [https://www.gnu.org/software/gdb/ gdb] - The basic tool for debugging in the GNU toolchain. gdb lets you e.g. break into the engine on a breakpoint or when a seg fault or assertion failure occurs. You can start your process in gdb or attach gdb to a running process. 24 * [http://valgrind.org/ valgrind] - Debugging and profiling suite. Find memory leaks, invalid memory accesses and more. 25 25 * [https://www.khronos.org/opengl/wiki/Debugging_Tools OpenGL Debugger] - Debug and profile OpenGL applications. Useful for debugging GL errors and finding unexpected behavior. 26 * A hex editor - useful for examining binary simulation state dumps, either for saved games or serialization errors.27 * [https://www.virtualbox.org/ VirtualBox] - virtual machines are very convenient for testing the game on other operating systems, or for testing multiplayer games locally. VBox is FOSS and works quite well.26 * A hex editor - Useful for examining binary simulation state dumps, either for saved games or serialization errors. 27 * [https://www.virtualbox.org/ VirtualBox] - Virtual machines are very convenient for testing the game on other operating systems, or for testing multiplayer games locally. VBox is FOSS and works quite well. 28 28 29 29 === macOS / OS X === 30 * [https://developer.apple.com/xcode/ Xcode] - free IDE for development on macOS, also has suite of debugging tools.30 * [https://developer.apple.com/xcode/ Xcode] - Free IDE for development on macOS, also has suite of debugging tools. 31 31 * gdb 32 * [http://lldb.llvm.org/ lldb] - part of the LLVM project, replacement for gdb in recent Xcode. LLDB equivalents for GDB commands can be found [https://lldb.llvm.org/use/map.html here].33 * [https://www.virtualbox.org/ VirtualBox] - virtual machines are very convenient for testing the game on other operating systems, or for testing multiplayer games locally. VBox is FOSS and works quite well.32 * [http://lldb.llvm.org/ lldb] - Part of the LLVM project, replacement for gdb in recent Xcode. LLDB equivalents for GDB commands can be found [https://lldb.llvm.org/use/map.html here]. 33 * [https://www.virtualbox.org/ VirtualBox] - Virtual machines are very convenient for testing the game on other operating systems, or for testing multiplayer games locally. VBox is FOSS and works quite well. 34 34 35 35 == Debugging Crashes and Assertion Failures == … … 163 163 1. The simulation state does not differ before and the AI gets the same input data. 164 164 165 You can add some debugging code to binaries/data/mods/public/simulation/helpers/Commands.js in the function ProcessCommand to print all the commands com ming from the AI. When using a replay you know which player number is the AI player and can filter the output like that:165 You can add some debugging code to binaries/data/mods/public/simulation/helpers/Commands.js in the function ProcessCommand to print all the commands coming from the AI. When using a replay you know which player number is the AI player and can filter the output like that: 166 166 167 167 {{{