Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Events on debug session status (stopped, running, etc.) #71020

Closed
haneefdm opened this issue Mar 23, 2019 · 5 comments
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality

Comments

@haneefdm
Copy link
Contributor

I am trying to create an extension or enhance the existing vscode-cpptools extension to add register and memory views. Lots of requests for these features in the cpptools area. While I think I can create such views, I have an issue with refreshing them and knowing when to refresh them

We already have events for start/terminate/changed (vscode.debug.onDidXXXXDebugSession) but no events for when the debugger session status has changed -- stopped/running.

If such event emitters exist, then I can keep track of the current status but it would be nice to also know what the current status is. Current Status is not a must-have.

If you like I can make a proposal and see if I can implement it and submit for approval?

Maybe there is already a way but I looked in the code/exported *.d.ts files and searched issues I saw nothing.

@haneefdm haneefdm changed the title Events on debug session status (stopped, running, etc.) Feature Request: Events on debug session status (stopped, running, etc.) Mar 23, 2019
@haneefdm
Copy link
Contributor Author

haneefdm commented Mar 25, 2019

Just to show you I am serious, I managed to create a view in the debug viewlet/pane and show the register section. About 200 lines of code, not production ready. I am able to debug a native program on my mac (x64, lldb) and a board (ARM, gdb) attached to my mac. It is just that I have to manually trigger a refresh of the register values. In my code, I also have to guess the type of CPU I am dealing with on a session by session basis.

Please see the attached images. One with dark theme is native on my Mac. Light theme is program running on a ARM board attached to the same Mac via USB

vscode

vscode-arm

@haneefdm
Copy link
Contributor Author

Please visit https://github.com/haneefdm/adv-cppdbg to see my extension.

@haneefdm
Copy link
Contributor Author

haneefdm commented Apr 1, 2019

Hi guys, I have an update. I got a workaround suggested by https://github.com/gregg-miskelly

Greggs idea was to use registerDebugAdapterTrackerFactory API to snoop on all the traffic between the Debug Adapter and VSCode.

Pretty invasive (and ugly) but it works for what I need. Bit of a performance hit, I am sure. Anything going wrong in the snooper can make the debug session to go nuts/stop.

It seems like you can have only one tracker per adapter? What if some other extension wants to track as well?

Waiting for your thoughts. My latest (ugly) code is https://github.com/haneefdm/adv-cppdbg and I also have a vsix file on there

@weinand
Copy link
Contributor

weinand commented Apr 1, 2019

"Anything going wrong in the snooper can make the debug session to go nuts/stop."

No, you cannot change anything from the tracker and exceptions are ignored.
The performance hit is small in comparison to running the DA in a different process (which happens anyway).
You can register multiple trackers per DA from different extensions.

Please let me know if you see issues that seem to contradict my claims from above.

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality labels Apr 1, 2019
@haneefdm
Copy link
Contributor Author

haneefdm commented Apr 1, 2019

Thanks, @weinand, I had a couple of instances where an exception in my code basically halted the debug session. Can't say what went wrong, pretty late into the night. I will watch out for it from now on and report.

Thanks for all your other clarifications.

@haneefdm haneefdm closed this as completed Apr 1, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants