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

debug: Ability to see the content of machine registers when debugging .s files #1527

Closed
petr-sneller opened this issue May 25, 2021 · 7 comments
Assignees
Labels
Debug Issues related to the debugging functionality of the extension. FeatureRequest FrozenDueToAge
Projects
Milestone

Comments

@petr-sneller
Copy link

There is currently no way to inspect the content of machine registers. For example if you have some code written in go assemler (.s) file - you can step into that file and even hit a breakpoint, but you cannot see the content of registers, which makes debugging of such files kind of useless.

It would be nice to be able to see the content of machine registers at least in .s files.

@gopherbot gopherbot added this to the Untriaged milestone May 25, 2021
@hyangah hyangah added this to Needs triage in Debug via automation May 25, 2021
@hyangah hyangah added Debug Issues related to the debugging functionality of the extension. DlvDAP labels May 25, 2021
@hyangah hyangah changed the title Ability to see the content of machine registers when debugging .s files debug: Ability to see the content of machine registers when debugging .s files May 25, 2021
@hyangah
Copy link
Contributor

hyangah commented May 25, 2021

That's a good idea.
With go-delve/delve#2446 (already released as v1.6.1), I am guessing the newest dlv already should provide some degree of support for register content inspection through DEBUG CONSOLE and the watch panel.
https://github.com/go-delve/delve/blob/master/Documentation/cli/expr.md#cpu-registers

But ideally, I hope we can see the list of registers (maybe through the VARIABLES viewlet when we stop at .s?). debugger.ScopeRegisters and debugger.ThreadRegisters look relevant. (https://github.com/go-delve/delve/blob/master/service/rpc2/server.go#L425 for reference)

cc @polinasok @suzmue

@hyangah hyangah added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 25, 2021
@hyangah
Copy link
Contributor

hyangah commented Jun 7, 2021

I chat with @suzmue and @polinasok.

Something to think about:

  • how to present the value by default?
    • is it sufficient to show as numbers in the hex format, and additional strings for flags such as Rflags as done by dlv cli)?
    • or, should we come up with a creative solution to utilize the richer expression?
  • should we set evaluateName? If yes, what that should be?
  • wouldn't the new assembly view of VSCode (Roadmap: Disassembly View Feature microsoft/vscode#124163) be more appropriate for assembly code inspection?

@hyangah hyangah added Thinking and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 7, 2021
@hyangah hyangah modified the milestones: Untriaged, Backlog Jun 7, 2021
@hyangah hyangah moved this from Needs triage to Low priority in Debug Jun 7, 2021
@petr-sneller
Copy link
Author

I'm on latest golang and delve, but I still cannot see the content of all registers.

I can type XMM0, R15, etc in debug console and it would print a content of a register. But it cannot print XMM16 and above, YMM, ZMM, and K registers.

In my settings, I have:

    "go.delveConfig":{
        "debugAdapter":"dlv-dap",
        "showRegisters": true
    },

But I still don't see any content of registers anywhere.

Is there a plan to fix this somehow?

@suzmue
Copy link
Contributor

suzmue commented Nov 18, 2021

Currently the value from the settings is not correctly passed through to the launch configuration. Will send a fix for this.

If you add "showRegisters": "true" to your launch configuration instead, it should work to display the register values.

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/365374 mentions this issue: src/goDebugConfiguration: update list of delveConfig properties

@petr-sneller
Copy link
Author

petr-sneller commented Nov 18, 2021

@suzmue That's a good tip, thanks :)

BTW I really enjoy the feature to run a specific test in a .go file, which doesn't really have a launch configuration at all. I wish this worked so I could just click on tests I want to debug like that :)

gopherbot pushed a commit that referenced this issue Nov 19, 2021
Update the list of delveConfig properties to merge.

Updates #1527

Change-Id: I52ca4657a5323f68f5b6178b3676510d0870365f
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/365374
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Suzy Mueller <suzmue@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@hyangah
Copy link
Contributor

hyangah commented Nov 22, 2021

The Go Nightly version includes Suzy's change. Would be nice if you can give it a try and verify it works.
Hopefully we release the next version with this fix soon.

@hyangah hyangah modified the milestones: Unplanned, v0.30.0 Dec 9, 2021
@hyangah hyangah closed this as completed Dec 9, 2021
@golang golang locked and limited conversation to collaborators Dec 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Debug Issues related to the debugging functionality of the extension. FeatureRequest FrozenDueToAge
Projects
No open projects
Debug
  
Low priority
Development

No branches or pull requests

4 participants