From 6c06192a22a34ffee25ed43876b62f0c42d36ff7 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 18 Jul 2024 15:03:41 +0100 Subject: [PATCH] Fixed issue #2250: Multiple 'DEBUG SESSION ENDED' messages with XDEBUG_SESSION_STOP_NO_EXEC --- src/base/base.c | 4 ---- tests/debugger/bug02250.phpt | 12 ++++++++++++ xdebug.c | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 tests/debugger/bug02250.phpt diff --git a/src/base/base.c b/src/base/base.c index 9c377a2ce..d5d5a8c53 100644 --- a/src/base/base.c +++ b/src/base/base.c @@ -838,10 +838,6 @@ static bool should_run_user_handler(zend_execute_data *execute_data) zend_op_array *op_array = &(execute_data->func->op_array); zend_execute_data *prev_edata = execute_data->prev_execute_data; - if (xdebug_debugger_bailout_if_no_exec_requested()) { - return false; - } - if (!ZEND_USER_CODE(op_array->type)) { return false; } diff --git a/tests/debugger/bug02250.phpt b/tests/debugger/bug02250.phpt new file mode 100644 index 000000000..9bf387296 --- /dev/null +++ b/tests/debugger/bug02250.phpt @@ -0,0 +1,12 @@ +--TEST-- +Test for bug #2250: Multiple 'DEBUG SESSION ENDED' messages +--INI-- +xdebug.mode=debug +--GET-- +XDEBUG_SESSION_STOP_NO_EXEC=netbeans-xdebug +--FILE-- + +--EXPECT-- +DEBUG SESSION ENDED diff --git a/xdebug.c b/xdebug.c index d5b3f6752..3f187a1c6 100644 --- a/xdebug.c +++ b/xdebug.c @@ -663,6 +663,10 @@ PHP_RINIT_FUNCTION(xdebug) } if (XDEBUG_MODE_IS(XDEBUG_MODE_STEP_DEBUG)) { xdebug_debugger_rinit(); + + if (xdebug_debugger_bailout_if_no_exec_requested()) { + zend_bailout(); + } } if (XDEBUG_MODE_IS(XDEBUG_MODE_DEVELOP)) { xdebug_develop_rinit();