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] Debug-hover variable when not at breakpoint #2745

Closed
csholmq opened this issue Feb 5, 2016 · 7 comments
Closed

[Feature-request] Debug-hover variable when not at breakpoint #2745

csholmq opened this issue Feb 5, 2016 · 7 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality

Comments

@csholmq
Copy link

csholmq commented Feb 5, 2016

When remote debugging (GDB in my case) and not being able to breakpoint, it would be super helpful to be able to read variables on the fly (e.g. with hover). The workflow of adding variables to Watch takes forever in comparison and doesn't continuously update.

For reference, this works in Eclipse where hover polls variables between breakpoints.

@isidorn isidorn added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Feb 9, 2016
@isidorn
Copy link
Contributor

isidorn commented Feb 9, 2016

This would only work if the GDB debug adapter would support evalute on hover, and if it supported evalution while not stopped (might support this already)
Also I would need to add a very small change on the vscode side, but the adapter would need to support this first. Thus forwarding this to @weinand

@csholmq
Copy link
Author

csholmq commented Feb 9, 2016

@isidorn Evaluation through a Watch is supported while not stopped. At least for Debug. I have created a ticket (WebFreak001/code-debug#10) to support evaluation on hover.

@weinand
Copy link
Contributor

weinand commented Feb 9, 2016

@csholmq @isidorn I don't think that this request makes sense.

Imagine this: the multi-threaded program is running and the user hovers over a variable i which makes VS Code send an evaluate "i" to the debug adapter. How should the debug adapter figure out what "i" the user is hovering over and then how should the adapter determine from what thread it should get the value for "i". For the first problem the debug adapter would have to know the source location of the "i" so that it could get the scope information of it. The second problem shows why this request doesn't make sense: thousands of "i" could be active in different threads, in deep stacks resulting from recursive code. What "i" should evaluate return?

I'm one of the original authors of Eclipse and the Java debugger, but I have to admit that I'm not aware of the fact that "the Eclipse hover polls variables between breakpoints". What debug plugin are you referring to?

@weinand weinand closed this as completed Feb 9, 2016
@csholmq
Copy link
Author

csholmq commented Feb 9, 2016

Agreed, this would of course only make sense on global variables. My colleague has written a GDB bridge for our embedded development and then uses a GDB plugin to poll global variables using hover (I'll double check which plugin).

As I'm an embedded developer working mainly with C, a simple p Module_Variable is what I'm looking to send. Then it's up to the debugger (in this case GDB) to lookup the memory address and return me the results.

This might only be valid for a structural language such as C.

@weinand
Copy link
Contributor

weinand commented Feb 9, 2016

@csholmq I suggest that you file a feature request "Make debug hover extensible" and then explain your exact use case (just copy your previous comment).
Currently the VS Code debugger is only extensible in the back end (debug adapters) but we are planning to open up the front-end too.

@csholmq
Copy link
Author

csholmq commented Feb 10, 2016

@weinand I checked with my colleague and he uses the C/C++ GDB Hardware Debugging plugin
7.0.0.201202111925 org.eclipse.cdt.debug.gdbjtag.feature.group Eclipse CDT

gdbsession

And this is what goes on in the Console (not same session):

(gdb) 
398-data-evaluate-expression ArOS100usTimerU32
398^done,value="5711095"
(gdb) 
399-data-evaluate-expression ArOS100usTimerU32
399^done,value="5729299"
(gdb) 
400-data-evaluate-expression ArOS100usTimerU32
400^done,value="5746632"
(gdb) 

As you can see, he starts up the debugging and then it stays in Suspended. Super helpful in embedded projects where you have e.g. current control loops running (in our case motor control) that you can't afford to breakpoint.

@weinand
Copy link
Contributor

weinand commented Feb 10, 2016

@csholmq Thanks for this info. Yes, with a plugin you can do this in Eclipse (but it is not the default behaviour of Eclipse debugging). I think that it should be possible to do something similar in VS Code after we've opened up the debugger front end for extensions.

CC @isidorn

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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

3 participants