Skip to content

Debugging overhaul and redesign #5950

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

Open
4 tasks
filipdutescu opened this issue Feb 12, 2023 · 14 comments
Open
4 tasks

Debugging overhaul and redesign #5950

filipdutescu opened this issue Feb 12, 2023 · 14 comments
Assignees
Labels
A-debug-adapter Area: Debug adapter client A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@filipdutescu
Copy link
Contributor

filipdutescu commented Feb 12, 2023

Description

The current debugging experience is less than ideal. While challenges are expected with TUI editors, the current experience is, to put it bluntly, raw. It is hard to launch or stop sessions, view variables, see which line the session is paused at etc. You also have no way to drill down into variable values (or if you have, it is so hidden I have yet to find it) or edit their values during a debugging session.

There is much more that should be done to ensure a smooth experience, including:

  1. defaults for binary targets (ie configuration type - Debug/Release, binary location - target/debug/myexe) which should be overridable in language.toml as well
  2. attach should show a searchable list of processes the user could choose from (search should include the option for process ID)
  3. [DAP] add inline values of variables during debugging #5927

Proposal

To address some of those pain points, I propose the following overhaul and redesign:

  • Add a new editor mode, alongside NOR, INS, SEL: the DBG mode, which would be basically NOR with extra configurable keybindings for the debugging commands. This would also remove the need for the sticky popup, which could be turned on by a new keybinding, such as ?, for example - Add DBG (Debug) editor mode #5951;
  • Highlight the current line at which execution is paused, This also means adding new theme colors for breakpoints and the current line - Better highlight breakpoints and current line at which execution is paused at #5952, Add better breakpoint icons #5956;
  • Add a new debug panel, which should be able to be placed in all cardinal points (left, top, bottom, right), containing at least: a variables panel (locals, arguments, registers etc.), watches, call stack and breakpoints. Those individual modules should also be able to be placed in any of the 4 directions by themselves, in order to have a more personal and customized UI. The variables should be expandable, showing their inner fields (private, protected and public) with their values. Those "children" should behave the same, if they are complex types. Watches and variable values should be editable with a prompt - Add a debug panel, containing sections with relevant debugging information #5954.
  • A quick watch popup should be made, which could start empty or from the current code selection, behaving similar to a picker, with expandable values for the result of the expression - Add a quick watch popup for easy debugging of expressions #5955.

Related issues

UI/UX mockups

New UI for debugging:
image

Help popup (using the current one as example):
image

Expanding a variable's value (same prompt and cursor highlighting should be used for watches as well):
image

Quick watch popup:
image

@filipdutescu filipdutescu added the C-enhancement Category: Improvements label Feb 12, 2023
@kirawi kirawi added A-helix-term Area: Helix term improvements A-debug-adapter Area: Debug adapter client labels Feb 12, 2023
@archseer
Copy link
Member

archseer commented Feb 13, 2023

For the variable views (the top pane called Locals -- it's technically variables), the idea was to repurpose the tree component from #2377 / #5768

@filipdutescu
Copy link
Contributor Author

For the variable views (the top pane called Locals -- it's technically variables), the idea was to repurpose the tree component from #2377 / #5768

Yes, I plan on using the exact same mechanism as proposed by you. That part (local pane) and the quick watch one would be dependent on either of the two linked PRs.

@filipdutescu
Copy link
Contributor Author

@CptPotato proposed a new design for the debug panel,which I like quite a bit. This is what I propose, moving forward:
image

@filipdutescu
Copy link
Contributor Author

filipdutescu commented Feb 23, 2023

Update on the current debug line (#5952). Latest developments lead me to this current implementation, which is a good MVP in my opinion. Further work can be done to improve the ability to customise components such as selection and cursor highlights, but they'll be out of scope for the current PR.

image

Dracula theme example:
image

Onedark example:
image

Ayu light example:
image

@filipdutescu
Copy link
Contributor Author

filipdutescu commented Mar 9, 2023

Update on the default theme. After talking some more with @archseer, we landed on this colour for the debug highlight, which I find beautiful:

image

@filipdutescu
Copy link
Contributor Author

Latest update: #5952 was merged, hope it is a pleasant addition and a nice start to the overhaul! Thanks a lot to @pascalkuthe and @archseer for the help with the issue!

@teburd
Copy link
Contributor

teburd commented Oct 26, 2023

Would a disasm split or register view be something to consider? Debugging low level code these features in gdb are incredibly helpful

@andreciobezerra
Copy link

I hope this proposal is going on, the helix is fantastic, but the debug is really experimental.

@filipdutescu
Copy link
Contributor Author

I have had some personal problems keeping me from dedicating sufficient time to tuis initiative. But all should start to clear up during summer, when I plan to get up to date with any progress made and pick it back up. Not sure what progress was made in the meantime though.

@gyreas
Copy link

gyreas commented Feb 23, 2024

Adding mouse actions like resizing the left pane would be nice, making the side pane windows collapsible would be another awesome addition too. By the way, who's had any luck using the debugger?

@flo8
Copy link

flo8 commented May 26, 2024

This feature would be amazing! @filipdutescu would it be possible to have also console output to be displayed? This can be also useful to debug console applications that require user input.
I actually thought about making a TUI specifically for Delve in Go as an addition to my Helix workflow. Your idea would even better as it would directly integrated into Helix.

@Rot127
Copy link

Rot127 commented May 31, 2024

To throw another "good to have" feature on the heap, it would be great if the interface supports data viewers of different languages.

E.g. having C + Rust is pretty common. And there are quite some bugs which occur during the interaction of the two.
If the debugger switches from a Rust file to a C file, it should be able to seamlessly show the C types.

I just can't find an IDE which does this without problems (RustRover doesn't show C types and in VSCode, Rust debugging is broken with complicated building scenarios).

@taylorpool
Copy link

Curious what the progress has been here. I love Helix and debugging!

@johan-lejdung
Copy link

This addition would be greatly appreciated! The current implementation is just not enough, I cannot list the values for the most part as they overflow from the tiny box I'm presented with.

Is there any active work on implementing this or is it still in the idea stage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debug-adapter Area: Debug adapter client A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

10 participants