microsoft / vscode-debugadapter-node

Debug adapter protocol and implementation for VS Code.
Other
273 stars 79 forks source link

Support arbitrary memory read/write #163

Closed phsilva closed 4 years ago

phsilva commented 6 years ago

Is it possible to allow vscode debuggers to read/write to arbitrary memory locations?

This will allow debuggers to have the good old Visual Studio debugger Memory view and implement a microcontroller register window similar to EmbSysRegView, screenshot below.

emsysregview)

I'll propose a PR if the idea seems acceptable in the protocol. Something similar to machine registers would also be great.

weinand commented 6 years ago

I cannot access the screenshot.

weinand commented 6 years ago

Currently there are no plans to add a generic Memory view to VS Code, so there is no real need to add this functionality to the DAP.

I suggest that you start by implementing a Memory View as an extension first. Since you can directly talk to your debug adapter from the extension through the "customRequest" API, it is not necessary to have official protocol for this. With this approach you can explore how the protocol and the UI could look like (and we do not have to commit to a new protocol and UI too early).

We could make the private protocol "official" if it has matured. And we could add generic UI to VS Code to make use of the protocol.

We are using the same approach for the loaded scripts view. Currently the UI exists in the node-debug extension only, but it already uses protocol that started as private protocol and was made official some milestones ago. It just waits for the Loaded Scripts view to be moved into core.

weinand commented 4 years ago

DAP has a "ReadMemory" request. Please see https://microsoft.github.io/debug-adapter-protocol/specification#Requests_ReadMemory