I am using Visual Studio Code (VS Code) for debugging my C++ program. I'd like to view the memory at a variable's address and also be able to view the assembly code of my program. I am looking around on VS Code and I am not seeing an option for such views. I checked around on the marketplace and I don't anything out there.
Not sure if I am not looking in the right place, but do these features exist for VS Code?
Thanks!
C/C++ for Visual Studio Code. C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS.
Use the Disassembly window To enable the Disassembly window, under Tools > Options > Debugging, select Enable address-level debugging. To open the Disassembly window during debugging, select Windows > Disassembly or press Alt+8.
I have been digging for these feature for a few days now. Unfortunately, It seems that it is currently unavailable.
In addition to it not having a memory viewer, it looks like VS Code's "debugger console" is just a simple wrapper for GDB and doesn't allow memory examination commands either.
There is now a feature request for the memory viewer and dissasembly feature. I suggest you up-vote if you are as interested in them as I am.
At this time (Feb 2018), it seems that this feature still hasn't made it into VSCode. However it is possible to use the -exec command in the VSCode Debug Console to run GDB commands. See https://code.visualstudio.com/docs/languages/cpp#_gdb-lldb-and-mi-commands-gdblldb
The GDB examine command "x" displays memory in various formats. So in the VSCode Debug Console
-exec x/64b 0x74ae70
will display 64 bytes in hexadecimal from 0x74ae70. See https://sourceware.org/gdb/onlinedocs/gdb/Memory.html for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With