Skip to content

Fix spurious continue in the debug mode #75

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

Merged
merged 1 commit into from
Jun 15, 2025

Conversation

georgiy-belyanin
Copy link
Contributor

This patch fixes the problem I came across when tried to use the
debugger on MacOS with arm64. When Lua hit breakpoint it captured it
though the program execution did not stop since the debug loop exited
almost instantly.

Debug prints showed that this happened due to the spurious wake ups of
the conditional variable cvRun. None of the methods notified this
conditional so it seems it is a spurious wake up. Probably it is
specific to the architecture.

This small patch fixes this by adding a predicate to the conditional
variable. It waits until the debugging is finished or there are
evals to run.

This patch fixes the problem I came across when tried to use the
debugger on MacOS with arm64. When Lua hit breakpoint it captured it
though the program execution did not stop since the debug loop exited
almost instantly.

Debug prints showed that this happened due to the spurious wake ups of
the conditional variable `cvRun`. None of the methods notified this
conditional so it seems it is a spurious wake up. Probably it is
specific to the architecture.

This small patch fixes this by adding a predicate to the conditional
variable. It waits until the debugging is finished or there are
evals to run.
georgiy-belyanin added a commit to tarantool/tarantool-vscode that referenced this pull request Jun 14, 2025
This patch introduces basic Tarantool debugging facilities into the
extension. Basically it is done using EmmyLuaDebugger [^1].

Set up the debugger using the following instructions.

* Insert debugger code in Tarantool application by pressing
  `Ctrl+Shift+P` (or `Cmd+Shift+P` on MacOS) and running `Tarantool:
  Insert debugger code` command.
* Start single Tarantool instance.
* Press `F5` or run `Debug: Start debugging` command by pressing
  `Ctrl+Shift+P` (or `Cmd+Shift+P` on MacOS).
* Choose `EmmyLua New Debugger` in the list. This debugging
  configuration would run automatically from now.
* Set up breakpoints & access the Tarantool instance through `Debug
  console` in the bottom panel.

These features are supported.

* Breakpoints.
* Step-by-step execution within the fiber.
* Multiple files support.
* Interacting with the local variables, console at the debug mode.

Needs EmmyLua/EmmyLuaDebugger#75 to be tested
on MacOS on arm64.

Closes #19

[^1] EmmyLua/EmmyLuaDebugger#75
@CppCXY CppCXY merged commit 44ef751 into EmmyLua:master Jun 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants