vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.42k stars 237 forks source link

Evaluate request: return memory reference (take 2) #1067

Open puremourning opened 4 months ago

puremourning commented 4 months ago

This implements 2 things:

First, we now return memoory references for all members of an evaluate request's response. This allows for dumping of memory around the results of mundane evaluation, such as variables, structs, etc.

Further, any evaluation result which is itself a pointer value gets the contained address as its memory address (as opposed to the load address of the pointer itslef). This in particular allows for dumping of arbitrary memory addresses by simply casting them to (void*) or some equivalent pointer type. This is consistent with other debug adapters.


@vadimcn I've re-opened this with a much simpler and more correct implementation. You can now dump any address simply by casting it to (void*) or a pointer. No longer guessing based on it being an integer.

here's a demo:

codelldb-watch-mem-dump