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

Implement Disassembly View and InstructionBreakpoints #11186

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented May 20, 2022

What it does

Leaving this as a draft for now, as there are some details I need to check to make sure instruction breakpoints are working correctly.

Addresses parts of #8136 by implementing InstructionBreakpoints and a disassembly view to and the return of the disassemble request.

This PR copies and adapts VSCode's implementation of the Disassembly View for Theia.

How to test

  1. In general: use any debugger that supports the disassemble request, and confirm that the behavior in Theia is consistent with the behavior in VSCode.
  2. For example...
  3. Install the CDT-GDB VSCode plugin
  4. Open this example workspace and execute the build task.
  5. Set a breakpoint in a.cpp and start debugging.
  6. When you hit a breakpoint, you should be able to open the context menu in the stack view and find the 'Open Disassembly View' command - it should also be available in the command palette.
  7. Disassembly should load.
  8. Scrolling should load more lines.

CQ

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added debug issues that related to debug functionality CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) labels May 20, 2022
@colin-grant-work colin-grant-work marked this pull request as draft May 20, 2022 21:53
@colin-grant-work colin-grant-work marked this pull request as ready for review June 9, 2022 17:06
@msujew msujew self-requested a review June 15, 2022 08:26
@vince-fugnitto vince-fugnitto self-requested a review June 17, 2022 12:49
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good. I noticed some unexpected behavior in regards to disassembly breakpoints:

image

As far as I can tell, debugging directly in the disassembly view is not supported, right (that's what the icon indicates)? Anyway, these breakpoints cannot be removed, and clicking on the breakpoint sidebar in the disassembly view only adds more breakpoints, instead of removing the existing ones.

Don't allow breakpoints if they're not supported
@colin-grant-work
Copy link
Contributor Author

@JonasHelming, would you be willing to push a bit to get the CQ through?

@vince-fugnitto
Copy link
Member

The CQ has been approved, thank you @JonasHelming for helping it get across the line 👍

@colin-grant-work
Copy link
Contributor Author

@msujew, I pushed a change (and meant to mention it - sorry) that addresses your comments. I have modified the enablement of the commands that manipulate all breakpoints to be available when only instruction breakpoints are present. I have also (and this makes it harder to test my last claim ;-)) added code that prevents the creation of instruction breakpoints for sessions that don't support them - an improvement, I believe, over VSCode's code.

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, looks good to me!

  • Hitting a breakpoint in the C code lets us open the disassembly view via a context menu / command.
  • Scrolling up/down in the disassembly view loads more instructions and (relatively accurate) changes the position within the list view.
  • Breakpoints within the disassembly view are disabled for cdt-gdb, definitely an improvements compared to vscode.

We can't really test the functionality of breakpoints within the disassembly view, but I'm fine with revisiting this if there are any problems with it and some extension has mature support for it.

@colin-grant-work colin-grant-work merged commit 70350c1 into eclipse-theia:master Jul 6, 2022
@colin-grant-work colin-grant-work deleted the feature/disassembly-view-vscode branch July 6, 2022 15:29
@colin-grant-work colin-grant-work added this to the 1.28.0 milestone Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) debug issues that related to debug functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants