-
-
Notifications
You must be signed in to change notification settings - Fork 10
feat: disable JIT debugging by default #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| zend_extension=php_debugger.so | ||
| php_debugger.start_with_request=no | ||
| xdebug.start_with_request=no | ||
| ; We need this because some of the functions in bench.php do deep recursion and the default nesting level is not enough | ||
| php_debugger.max_nesting_level=2048 | ||
| xdebug.max_nesting_level=2048 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| zend_extension=php_debugger.so | ||
| xdebug.start_with_request=no | ||
| ; We need this because some of the functions in bench.php do deep recursion and the default nesting level is not enough | ||
| xdebug.max_nesting_level=2048 | ||
| xdebug.on_demand_debugging_enabled=1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -615,7 +615,7 @@ static void xdebug_init_debugger() | |
|
|
||
| /* If socket was already established by early connect at RINIT, | ||
| * skip straight to protocol initialization */ | ||
| if (XG_DBG(context).socket >= 0) { | ||
| if (XG_BASE(early_connection)) { | ||
| xdebug_str_add_fmt(connection_attempts, "%s:%ld (through xdebug.client_host/xdebug.client_port)", XINI_DBG(client_host), XINI_DBG(client_port)); | ||
| } else { | ||
| if (strcmp(XINI_DBG(cloud_id), "") != 0) { | ||
|
|
@@ -654,6 +654,8 @@ static void xdebug_init_debugger() | |
| xdebug_log_ex(XLOG_CHAN_DEBUG, XLOG_ERR, "NOPERM", "No permission connecting to debugging client (%s). This could be SELinux related.", connection_attempts->d); | ||
| } | ||
|
|
||
| XG_BASE(statement_handler_enabled) = XG_DBG(remote_connection_enabled); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the on-demand path where it was just flipped true by xdebug_connect_to_client(), will we reach this after the connection succeeds? otherwise we may end up with the flag bouncing false→true→false |
||
|
|
||
| xdebug_str_free(connection_attempts); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -878,8 +878,6 @@ void xdebug_debugger_rinit(void) | |
| { | ||
| char *idekey; | ||
|
|
||
| xdebug_disable_opcache_optimizer(); | ||
|
|
||
| /* Get the ide key for this session */ | ||
| XG_DBG(ide_key) = NULL; | ||
| idekey = xdebug_debugger_get_ide_key(); | ||
|
|
@@ -1223,6 +1221,16 @@ PHP_FUNCTION(xdebug_break) | |
| { | ||
| RETURN_FALSE_IF_MODE_IS_NOT(XDEBUG_MODE_STEP_DEBUG); | ||
|
|
||
| if (!xdebug_is_debug_connection_active() && !XINI_DBG(on_demand_debugging_enabled)) { | ||
| xdebug_log_ex(XLOG_CHAN_DEBUG, XLOG_INFO, "JIT-OFF", | ||
| "xdebug_break() ignored: no active debug connection and " | ||
| "xdebug.on_demand_debugging_enabled is not enabled"); | ||
| php_error(E_NOTICE, | ||
| "xdebug_break() ignored: no active debug session and on-demand debugging is disabled. " | ||
| "Set xdebug.on_demand_debugging_enabled=1 to enable mid-request debugging"); | ||
| RETURN_FALSE; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add logging? or something along the lines |
||
| } | ||
|
|
||
| xdebug_debug_init_if_requested_on_xdebug_break(); | ||
|
|
||
| if (!xdebug_is_debug_connection_active()) { | ||
|
|
@@ -1239,8 +1247,19 @@ PHP_FUNCTION(xdebug_connect_to_client) | |
| { | ||
| RETURN_FALSE_IF_MODE_IS_NOT(XDEBUG_MODE_STEP_DEBUG); | ||
|
|
||
| if (!XINI_DBG(on_demand_debugging_enabled)) { | ||
| xdebug_log_ex(XLOG_CHAN_DEBUG, XLOG_INFO, "ON-DEMAND-OFF", | ||
| "xdebug_connect_to_client() ignored: xdebug.on_demand_debugging_enabled is not enabled"); | ||
| php_error(E_NOTICE, | ||
| "xdebug_connect_to_client() ignored: On-demand debugging is disabled. " | ||
| "Set xdebug.on_demand_debugging_enabled=1 to enable mid-request debugging"); | ||
| RETURN_FALSE; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
| } | ||
|
|
||
| XG_DBG(context).do_connect_to_client = 1; | ||
|
|
||
| XG_BASE(statement_handler_enabled) = true; | ||
|
|
||
| RETURN_TRUE; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also update the Xdebug compatibility table?