Closed csholmq closed 8 years ago
:+1: gonna implement
Actually Im not quite sure if this would make sense, as it would only support global variables because variables in functions keep changing, for example children of a class. Im gonna try and do my best
But it makes total sense for global variables! :) Especially for structural languages such as C.
Here's how I use your plugin with my remote target (GDB) and polling variables using Watch:
I dont think this will actually work for running symbols if not using gdbserver or something else.
For me it gives an error when trying to access a global variable while the program is running: Cannot access memory at address 0x6008f4
@WebFreak001 I get that when I use the wrong offset. Does it work for you using a Watch?
I am currently testing it in the watch. It only works when the program is paused, otherwise it tells me "cannot access memory". Here is my used code:
#include <stdio.h>
int GlobalVariable = 0;
int main() {
printf("Hello World\n");
while(1) {
GlobalVariable++;
}
return 0;
}
Well I'm in a remote target debug; don't know if that makes a difference. I just press Start once and then a add-symbol-file My_Elf_File.elf 0x8020000
in the console.
If I press Continue or Step, everything stops working.
"name": "Debug GDB",
"type": "gdb",
"request": "attach",
"target": ":4444",
"remote": true,
In theory its implemented now. However vscode does not seem to call evaluate for me. Maybe its implemented in the february release?
Great. According to https://github.com/Microsoft/vscode/issues/2745#issuecomment-181765580 they need to add support in VSCode to evaluate whilst not paused.
I mean it also doesn't get called when its paused (on a breakpoint)
Hmm. Then I don't really know what's going on.
Is there a difference to "Paused" and "Stopped"?
There is only a StopEvent that I need to send when the program pauses. If it completely quits I need to send a TerminatedEvent. I think this is a vscode bug or they only have it in the current development version. I only have the January release
Not really sure of the current status atm. But now when I start my remote debug it seems to stop at inside an arbitrary function (same every time, with no breakpoint set) and spoofs a call stack.
I can also hover variables (call stack only) so that part seems to work (as long as it thinks it's paused).
As soon as I change view or reload symbols however, the call stack disappears, together with the ability to hover variables. So with https://github.com/Microsoft/vscode/issues/2833 we can hopefully alter that behavior to have hover polling on at all stages of debug.
now working in latest release!
In order for this to work, it appears that the extension needs to support
https://github.com/Microsoft/vscode/issues/2745#issuecomment-181765580 https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/common/debugProtocol.d.ts#L489