microsoft/vscode-cpptools

[Feature Request] Memory viewer when debugging

joshthielen opened this issue Β· 30 comments

Could you please add a memory browsing window to enable viewing of memory contents when debugging with gdb? It would also be great if the contents of watch variables / pointer locations could be easily shown in the memory browsing window (e.g. context-sensitive menu with 'View memory here').

I'm also waiting for this. The small workaround to watch one addr is to define memory pointer and add it to watching values. This is working for me.

This is a standard feature I look for in any debug GUI. It is extremely helpful to observe the data structure's memory as the code executes to get a full understanding of the system.

I hope this can be prioritized and implemented in a milestone soon

yes please add this is a standard feature

This would be a fantastic feature. This is the one reason I still run my code via gdb or lldb (depending upon which machine I'm working on) at the terminal instead of via vscode. Running exec x/ commands in the VSCode terminal just isn't an equivalent.

Any updates on this feature?

@hyt589 We don't currently have any plans to implement this.

If your host machine is Windows, you could use Visual Studio's memory/registers viewer when debugging on Windows or remote Linux targets: https://docs.microsoft.com/en-us/cpp/linux/deploy-run-and-debug-your-linux-project?view=vs-2019.

Please add this to the roadmap! That's a standard feature to debug in embedded systems with gdb. When developing my projects with VSCode, I still need to run eclipse in parallel for debugging because of this missing feature.

I too would love this feature ❀️

For reference, here's the DAP spec change: microsoft/debug-adapter-protocol#50
WIP implementation: microsoft/MIEngine#816 (comment)

@hyt589 We don't currently have any plans to implement this.

If your host machine is Windows, you could use Visual Studio's memory/registers viewer when debugging on Windows or remote Linux targets: https://docs.microsoft.com/en-us/cpp/linux/deploy-run-and-debug-your-linux-project?view=vs-2019.

I might as well not use vscode and use visual studio instead . . . pretty disappointing.
I heard similar views when searching for a way of profiling, with many referring to visual studio πŸ˜•

We are investigating ways to add a memory view to this extension using the VS Code Hex Editor

Ran into the same problem. For others who are stuck here: I am using a program called "Cheat Engine" in the meantime to look at disassembly and memory. It can connect to a running process and has a nice memory and disassembly. I copy the memory addresses from my VS Code debugging session over and can look at the memory (Ctr+G to jump to address).

@Danvil, thanks for the info on Cheat Engine. Looks promising, but looks only to support Windows an Mac, unfortunately not Linux. Still going to check it out though, thanks.

Why is it taking so long to commit to this\add this feature. Looking at memory and the state of memory is a pretty common operation if you think about it. Visual studio\Windbg\gdb have supported this, when is vscode going to get this?

upvote

upvote

upvote

Upvotes are tracked using the πŸ‘ in the first comment. Make sure you click on the πŸ‘.

4 year~~

They focus on the disassembly view at the moment.

Hey everyone,

I started development on the MemoryView on my own, as I would really love to see this feature in vscode. https://github.com/oltdaniel/vscode-cpptools/tree/feature/memoryView

However, I'm currently stuck at getting information about the different Debug Session events like "pause". As this is my first every development with VSCode and its extensions, I don't have a perfect overview of everything. But the basic visualization is done and reading the memory is already supported by the underlying Debug Adapter Protocol.

There are some more or less active branches like https://github.com/microsoft/vscode/tree/connor4312/debug-read-memory at the main Editor Repo or https://github.com/microsoft/vscode-cpptools/tree/dev/waan/addMemoryView in this repo.

As this feature is required for a project of my own, I would love to contribute to this feature. Maybe @connor4312 or @WardenGnaw can tell us more.

Yes, we are actively working on supporting DAP readMemory and writeMemory in VS Code core. This was put on pause last month for our housekeeping iteration, but will resume next week. Active development is mostly happening in the hex editor to support arbitrarily large files via a streaming model, which will be used support for program memory. readMemory is likely land in the November iteration.

This work can be tracked in microsoft/vscode#126268

Closing this issue in favor for implementation in core VS Code.

The debug adapter already supports readMemory as it is used in the disassembly window.

See microsoft/vscode#126268

Why this has been closed? the disassembly window is not the same as a Memory View window. And the hex editor can only open files, not the debugging memory with specific address.

So, MIEngine finished their works but still not done in VSCode, please keep tracking this feature request.

Why this has been closed? the disassembly window is not the same as a Memory View window. And the hex editor can only open files, not the debugging memory with specific address.

So, MIEngine finished their works but still not done in VSCode, please keep tracking this feature request.

It is there, but has been implemented in an annoying and arbitrarily limited way. You are expected to hover over a variable in the locals section of the debugger side bar and click the hex icon. This opens up the hex editor to view the memory at the address pointed to by the local variable.

There is still no way to view any memory address. If you want to view any memory, you have to have a local pointer variable to it. You can't even view memory at addresses in registers.

I've created an extension that right now allows you to view a decent buffer of memory hex at an entered address: https://marketplace.visualstudio.com/items?itemName=NateAGeek.memory-viewer

Still very much a work in progress but feel free to tell me if it works well for cpp πŸ€™

Fyi this shipped in VS Code in January of this year https://code.visualstudio.com/updates/v1_64#_viewing-and-editing-binary-data

C++ supports this, via the "memory" icon when hovering on a variable

image

@connor4312 My extension uses the "readMemory" and "writeMemory" DAP messages. So, it should work with any language implementation that supports those DAP messages.