View Issue Details

IDProjectCategoryView StatusLast Update
0001997XdebugStep Debuggingpublic2021-10-04 09:32
Reporterbeberlei Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version3.0.4 
Target Version3.1devFixed in Version3.1.0 
Summary0001997: Added xdebug_connect_to_client() to attempt a debugging connect while running code
Description

In a long running process that is processing a worker queue, the PHP job is started a long time ago, but when I start the debugger from the IDE, then I need to restart the worker script so that It realizes that there is an active debugging session.

Could it be possible to have a function "xdebug_attempt_debug_session()" or something that mimics what happens in RINIT for the step debugger?

Then I could run it inside my processing queue loop:

while ($task = $queue->nextTask()) {
xdebug_attempt_debug_session();

$task->process();

}

TagsNo tags attached.
Operating System
PHP Version8.0.0-8.0.4

Activities

derick

2021-07-22 11:01

administrator   ~0005932

Wouldn't using https://xdebug.org/docs/all_functions#xdebug_break in combination with xdebug.start_upon_request=trigger not work for you?

beberlei

2021-07-22 14:51

reporter   ~0005935

Its a first step, didn't know this existed. However it would break on every loop entry of every worker, even tough the breakpoint in the IDE might not be related to any code running inside a worker at the moment. The usability would be better if it would just (re)connect to the IDE and not break.

derick

2021-07-28 11:08

administrator   ~0005947

Sorry, put the wrong one in feedback.

derick

2021-07-30 08:08

administrator   ~0005949

https://github.com/xdebug/xdebug/pull/765

Issue History

Date Modified Username Field Change
2021-07-21 12:01 beberlei New Issue
2021-07-22 11:01 derick Assigned To => derick
2021-07-22 11:01 derick Status new => feedback
2021-07-22 11:01 derick Note Added: 0005932
2021-07-22 14:51 beberlei Note Added: 0005935
2021-07-22 14:51 beberlei Status feedback => assigned
2021-07-25 18:15 derick Target Version => 3.1dev
2021-07-25 18:15 derick Severity minor => feature
2021-07-28 11:04 derick Status assigned => feedback
2021-07-28 11:08 derick Status feedback => confirmed
2021-07-28 11:08 derick Note Added: 0005947
2021-07-30 08:08 derick Note Added: 0005949
2021-08-01 15:38 derick Summary Allow programmatic API to connect to IDE => Added xdebug_connect_to_client() to attempt a debugging connect while running code
2021-08-01 15:38 derick Status confirmed => closed
2021-08-01 15:38 derick Resolution open => fixed
2021-08-01 15:38 derick Fixed in Version => 3.1dev
2021-09-05 16:15 derick Fixed in Version 3.1dev => 3.1.0beta1
2021-10-04 09:32 derick Fixed in Version 3.1.0beta1 => 3.1.0