Skip to content

Debug context lost on multiple connections #301

Description

@ettoredn

Relates to: #19 #167 #294 #231
PHP version: 7.2.7
XDebug version: 2.6.0
Adapter version: 1.12.5

Issue

When multiple connections are received, the debug context of the previous connection(s) cannot be retrieved from the editor.

For larger codebases (tested with WordPress) it seems that both debug contexts are lost resulting in an empty 'Call Stack', meaning the 'Call Stack' window is empty. The first connection is kept paused, whereas the second gets executed without pausing.

Steps to reproduce

Given the following PHP script debug-multi.php:

$a = ['bee', 'tiger', 'bear', 'deer'];
xdebug_break();
var_dump($a);

Step 1
Open a terminal and execute export XDEBUG_CONFIG="idekey=vscode"; php debug-multi.php.
The adapter correctly stops on the line following xdebug_break():

image

image

Step 2
Open a terminal and execute export XDEBUG_CONFIG="idekey=vscode"; php debug-multi.php.
The adapter correctly stops on the same line as step 1, but the previous request is shown as "Running" even if it is still paused (shell command has not returned):

image

image

Configuration settings

launch.json:

"name": "Listen for XDebug",
"type": "php",
"request": "launch",
   "port": 9000,
   "xdebugSettings": {
   "max_depth": 1,
    "max_children": 10
},
"log": true

php.ini:

xdebug.remote_enable = 1
xdebug.profiler_output_dir=/Users/ettore/Workspace/xdebug/profiling
xdebug.profiler_output_name=%u.%R
xdebug.profiler_enable_trigger=1
xdebug.remote_log = /Users/ettore/Workspace/xdebug/xdebug.log

Logs

First connection

1-adapter.log

Second connection

2-adapter.log

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