Skip to content

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

Open

Description

@shtrom

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions