You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debug API / Ask Debugger to Evaluate a given Expression #42989
*out-of-scopePosted issue is not in scope of VS CodeapidebugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionality
For a very cool extension I have in mind, I would love to be able to ask the active debugger (if there is an active debug session) to evaluate a given expression and get back the result of that evaluation.
My ultimate goal is to provide a watch-window like pane that visualizes given expressions (like svg, graphs, matrices or tables).
At the moment we have no plans to duplicate the Debug Protocol as extension API.
But you can use the DebugSession.customRequest(...)API to run any DAP request.
The following code to run the "evaluate" request works for me:
changed the title [-][Feature Request] Debug API / Ask Debugger to Evaluate a given Expression[/-][+]Debug API / Ask Debugger to Evaluate a given Expression[/+]on Feb 6, 2018
Now I see what I did wrong - in order to access local variables, I have to pass a frameId, otherwise I just get "not available". How do I get the frameId of the current frame?
Is there an event that fires when the debugger halts so that I can re-evaluate all my expressions?
Andre Weinand (@weinand) I have tried the code that you exposed above and the const session = vscode.debug.activeDebugSession; returns undefined. I have made a question on SO about it. Some ideas?
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
*out-of-scopePosted issue is not in scope of VS CodeapidebugDebug viewlet, configurations, breakpoints, adapter issuesfeature-requestRequest for new features or functionality
Activity
weinand commentedon Feb 5, 2018
At the moment we have no plans to duplicate the Debug Protocol as extension API.
But you can use the
DebugSession.customRequest(...)API to run any DAP request.The following code to run the "evaluate" request works for me:
To try this:
Observe: the result of the expression "Math.sqrt(10)" will be shown in an info notification.
[-][Feature Request] Debug API / Ask Debugger to Evaluate a given Expression[/-][+]Debug API / Ask Debugger to Evaluate a given Expression[/+]hediet commentedon Feb 6, 2018
Now I see what I did wrong - in order to access local variables, I have to pass a frameId, otherwise I just get "not available". How do I get the frameId of the current frame?
Is there an event that fires when the debugger halts so that I can re-evaluate all my expressions?
robe007 commentedon Feb 22, 2019
Andre Weinand (@weinand) I have tried the code that you exposed above and the
const session = vscode.debug.activeDebugSession;returns undefined. I have made a question on SO about it. Some ideas?vscodebot commentedon Oct 14, 2019
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!