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

Race condition on path_maps when setting breakpoints before starting vdebug #495

Open
shtrom opened this issue Dec 15, 2020 · 0 comments
Open

Comments

@shtrom
Copy link

shtrom commented Dec 15, 2020

Reproduction

  1. Set up some path_maps and disable break_on_stop
  2. Set a breakpoint in a mapped file with
  3. Start the debugger with
  4. Start the (PHP/XDebug) script

I don't know if setting a breakpoint before starting the debugger is a supported use-case, but I didn't find anything in the documentation that suggested it wasn't.

This could be stated more clearly or, alternatively, the debugger could be implicitely started when trying to set the first breakpoint.

Expected

The debugger stops on the breakpoint

Actual

The debugger continues to completion.

Notes

When swapping steps 2 and 3, so starting the debugger first, THEN setting a breakpoint, we get the actual behaviour.

Looking at the logs, it seems like all the vim parameters are sent to the debugger only on start, but breakpoints are allowed to be defined before that.

Some debugging with the following command follows

vim -c "VdebugOpt debug_file ~/vdebug.log" -c "VdebugOpt debug_file_level 2" /Volumes/dev/api-data/src/someentry.php" +607

Start before Breakpoint

- [Debug] {Tue 15 2020 17:34:02} Started
- [Debug] {Tue 15 2020 17:34:02} Listening on port 9000
- [Info] {Tue 15 2020 17:34:03} Dispatching set_breakpoint event
- [Debug] {Tue 15 2020 17:34:03} ** SetBreakpointEvent
- [Debug] {Tue 15 2020 17:34:03} Replacing local path (/Volumes/dev/api-data) with remote path (/srv/api/data)
- [Info] {Tue 15 2020 17:34:03} Adding line breakpoint, id 11000

And the breakpoint is honoured.

Breakpoing before Start

 [Info] {Tue 15 2020 17:37:43} Dispatching set_breakpoint event
- [Debug] {Tue 15 2020 17:37:43} ** SetBreakpointEvent
- [Info] {Tue 15 2020 17:37:43} Adding line breakpoint, id 11000
- [Debug] {Tue 15 2020 17:37:43} Started
- [Debug] {Tue 15 2020 17:37:43} Listening on port 9000
- [Debug] {Tue 15 2020 17:37:48} Found client, ('127.0.0.1', 51665)
- [Debug] {Tue 15 2020 17:37:48} Finishing socket server

And the breakpoint is not honoured, as the local path has not been replaced.

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

No branches or pull requests

1 participant