View Issue Details

IDProjectCategoryView StatusLast Update
0001984XdebugUncategorizedpublic2021-06-21 12:46
Reporterrulatir Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionno change required 
Product Version3.0.0 
Summary0001984: Can step debugging and profiling be separately triggerable?
Description

Is it possible (as of Xdebug 3.0 and its simplified configuration) to have a single, never-need-to-edit, never-need-to-restart-php-fpm-container xdebug.ini configuration that will support:

  • develop by default
  • step debugging (but not profiling) upon a trigger
  • profiling (but not step debugging) upon a different trigger

?

If so, how?

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

Activities

exussum

2021-06-14 11:36

reporter   ~0005903

You can enable multiple modes at the same time by comma separating their identifiers as value to

xdebug.mode: xdebug.mode=develop,debug,profile

The triggers for debug are
XDEBUG_SESSION_START
in GET / POST / ENV for debug

and
XDEBUG_TRIGGER
in GET/POST/ENV for profiling

derick

2021-06-16 18:17

administrator   ~0005905

Hi!

This is certainly possible.

Set xdebug.mode=develop,debug,profile

And then you can either use a browser extension as described in the documentation (https://xdebug.org/docs/step_debug#browser-extensions), or specifically trigger
step debugging with a GET/POST/ENV/COOKIE named "XDEBUG_SESSION", or
profiling with a GET/POST/ENV/COOKIE named "XDEBUG_PROFILE"
This is all described in the documentation at https://xdebug.org/docs/all_settings#start_with_request

I am creating a (short) video/animation of this at the moment as well, which will show up at my YouTube channel at https://www.youtube.com/playlist?list=PLg9Kjjye-m1g_eXpdaifUqLqALLqZqKd4

Please do note, that this is a bug tracker, and not a support forum. For support options, including (free) community support, please refer to https://xdebug.org/support

cheers,
Derick

rulatir

2021-06-21 12:14

reporter   ~0005913

I understand that if I start with xdebug.mode=develop,debug,profile, I will always be paying the performance penalty of debug, and see spurious "Debugging session finished without stopping on a breakpoint, check your path mappings yadda yadda yadda" notifications in my IDE. Is that correct? If so, is that avoidable?

I should have been more pedantic when asking the question. When I asked "develop by default", I should have emphasized: "develop (but not debug or profile) by default".

rulatir

2021-06-21 12:46

reporter   ~0005914

Allright, I had some difficulties figuring the right combination of settings to avoid always paying the debug performance penalty, but I will follow your video tutorial and report back.

Issue History

Date Modified Username Field Change
2021-06-11 13:03 rulatir New Issue
2021-06-14 11:36 exussum Note Added: 0005903
2021-06-16 18:17 derick Assigned To => derick
2021-06-16 18:17 derick Status new => closed
2021-06-16 18:17 derick Resolution open => no change required
2021-06-16 18:17 derick Note Added: 0005905
2021-06-21 12:14 rulatir Note Added: 0005913
2021-06-21 12:46 rulatir Note Added: 0005914