Visual Studio Debugger Annoyances
I do most of my game development on Linux, and I’m very happy with GDB, but when I have to do some debugging on Windows, Visual Studio is my debugger of choice.
In this post I’ll lightly rant about some of the features (or lack thereof) of the Visual Studio 2015 debugger:
Let me add notes to variables in the Watch window. I often need to watch raw memory locations casted to the appropriate type (i.e.
(Entity*)0x10021F0
) in order to keep an eye on variables that are out of scope of the current function but I know still exist. Without notes I sometimes have the watch window full of hex addresses casted to the same type, but no idea which one is which. A typical use case is watching a stack variable when stepping into a function.In GDB I don’t have this problem because I can easily scroll back and see the entire debugging session, and search through it with few keystrokes.
Let me highlight a memory range in the Memory window. Maybe by dragging to select bytes and right-clicking. This would in order to easily find the memory location when juggling multiple memory windows or jumping around a lot. I don’t know about you, but I really think the Memory window should get more love.
In GDB I use the awesome gdb-dashboard to keep an eye on multiple memory blocks of arbitrary sizes, as well as the following
define
that dumps a memory address+length:
Show me the string length when inspecting a string in the Text Visualizer! Please, just add a little text box with the string length.
- Let me see the byte representation of a string when viewing it in the Text Visualizer (similar to the Memory window).
- Let me drag the value of a
char[]
as an address to a new cell just like I can withchar*
. - Show me the memory address of a byte when mousing over an octet in a Memory window.
- Add the “Hexadecimal display” toggle in the contextual menu for other windows too, (e.g. in the disassembly window), not only in the watch/locals/autos windows.
- Let me drag out of scope variable addresses to the Memory window (useful when stepping into a function and want to inspect outer scope stack variables that are still valid).