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

Debugger #1967

Open
Tracked by #3131
dacap opened this issue Jan 3, 2019 · 2 comments
Open
Tracked by #3131

Debugger #1967

dacap opened this issue Jan 3, 2019 · 2 comments
Labels
feature Feature request, or something should be improved scripting Related to scripting API
Milestone

Comments

@dacap
Copy link
Member

dacap commented Jan 3, 2019

Create a simple debugger UI for Lua scripts.

A possible solution would be using a VS Code extension:

Or a CLI debugger:

Check these issues:

@dacap dacap added feature Feature request, or something should be improved scripting Related to scripting API labels Jan 3, 2019
@dacap dacap added this to the v1.3 milestone Jan 3, 2019
@dacap dacap self-assigned this Sep 8, 2021
@dacap dacap added the wip label Sep 8, 2021
@dacap
Copy link
Member Author

dacap commented Sep 8, 2021

I'm doing some work with this one from time to time (while waiting for compilation, etc.).

@dacap
Copy link
Member Author

dacap commented Oct 5, 2021

There is already a minimal working version: https://twitter.com/davidcapello/status/1445174960419442689

Screen Shot 2021-10-05 at 14 01 55

Screen Shot 2021-10-05 at 14 04 53

I'm still thinking what could be the best approach for the debugger. There are 3 main states for this dialog:

  1. Hidden: the Lua debugging hook (lua_sethook) is disabled
  2. Visible: the Lua hook is installed but we shouldn't stop in the next executed line (LUA_HOOKLINE), but in case of error the debugger will show the line of the error in context
  3. Visible & Running: The Lua hook is installed and we are waiting it to stop/break the execution of the script in some way

When we open the dialog, I think one possible behavior could be this:

  1. By default: break on the next executed line, so when we open the dialog, it already starts in the Visible & Running state, like in a "Step In" instruction
  2. If the user presses the Pause button: the debugger will not break in the next executed line (only in a breakpoint if there is any configured, or show an error, it's the Visible state)
  3. When it's paused, the Play button could show a popup to search the script to start + an option to wait for the next instruction that is executed (e.g. from plugins or dialog callbacks)
  4. The breakpoint button should show the list of enabled breakpoints + a list of scripts to open/navigate to add breakpoints, and clicking in some line at the left side of the displayed file should add a new breakpoint in that line.

I forgot to mention: there should be a possibility to view variables/locals and eval expressions.

dacap added a commit that referenced this issue Oct 12, 2021
Incomplete version of the Lua debugger.
Some available features:

* Break in next executed instruction
* Step in, over, out
* See & navigate stacktrace
* See local variables

Some missing features:

* Breakpoints
* Eval user expressions with local variables

The UX needs some improvement yet.
@dacap dacap modified the milestones: v1.3, v1.3-beta7 Oct 12, 2021
@dacap dacap removed the wip label Oct 14, 2021
@dacap dacap modified the milestones: v1.3-beta7, v1.3-beta8 Oct 26, 2021
@dacap dacap modified the milestones: v1.3-beta8, v1.3-beta9 Jan 12, 2022
@dacap dacap mentioned this issue Jan 14, 2022
3 tasks
@dacap dacap modified the milestones: v1.3-beta12, v1.3-beta13 Mar 14, 2022
@dacap dacap modified the milestones: v1.3-beta15, v1.3.1 Jun 1, 2022
@dacap dacap removed their assignment Sep 15, 2022
@dacap dacap modified the milestones: v1.3.1, 1.3.2, v1.3.2, v1.3.3 Nov 28, 2023
@dacap dacap modified the milestones: v1.3.3, v1.3.4, v1.3.5 Feb 14, 2024
@dacap dacap removed this from the v1.3.5 milestone Feb 28, 2024
@dacap dacap added this to the v1.3.6 milestone Feb 28, 2024
@dacap dacap modified the milestones: v1.3.6, v1.3.7 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request, or something should be improved scripting Related to scripting API
Projects
None yet
Development

No branches or pull requests

1 participant