View Issue Details

IDProjectCategoryView StatusLast Update
0001997XdebugStep Debuggingpublic2021-10-04 09:32
Reporterbeberlei Assigned To 
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