Reputation: 12939
I am writing my own debugger in VS code for a custom language. Everything works fine, when I click "step over" my program is being debugged correctly, but I cannot see anything in the editor. I think the problem is the "stoppedOnStep" event, I followed the tutorial here: https://code.visualstudio.com/api/extension-guides/debugger-extension but there is no way to send line number or file name in the "stopped" events.
Here is the event in the code example: this.sendEvent(new StoppedEvent('step', MockDebugSession.THREAD_ID));
and as you can see, no info on file name of line number, so I have no idea how that part of the debugger works. How does the debugger client know on which line is the program stopped? Is there some secret getLine()
method that reads the line number from the runtime?
Upvotes: 0
Views: 403
Reputation: 12939
Turns out the answer is in the stack trace. After the stopOnStep
event (or any other event), the editor sends a stack trace request to the debugger, and the last entry is the current line of the execution.
Upvotes: 1