From 004249cec97d346af51b3fec25321d4585c6d867 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Wed, 20 Nov 2013 17:09:06 +0000 Subject: [PATCH] fix bug, allow init access to vm uninterrupted --- phpdbg.c | 7 ++++++- phpdbg.h | 1 + phpdbg_prompt.c | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/phpdbg.c b/phpdbg.c index ec10677529..a456c2a149 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -654,8 +654,13 @@ phpdbg_main: /* initialize from file */ zend_try { - phpdbg_init(init_file, init_file_len, init_file_default TSRMLS_CC); + PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING; + phpdbg_init( + init_file, init_file_len, + init_file_default TSRMLS_CC); + PHPDBG_G(flags) &= ~PHPDBG_IS_INITIALIZING; } zend_catch { + PHPDBG_G(flags) &= ~PHPDBG_IS_INITIALIZING; if (PHPDBG_G(flags) & PHPDBG_IS_QUITTING) { goto phpdbg_out; } diff --git a/phpdbg.h b/phpdbg.h index 2f99543c6f..108db3759d 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -98,6 +98,7 @@ #define PHPDBG_IS_REGISTERED (1<<16) #define PHPDBG_IS_STEPONEVAL (1<<17) +#define PHPDBG_IS_INITIALIZING (1<<18) #ifndef _WIN32 # define PHPDBG_DEFAULT_FLAGS (PHPDBG_IS_QUIET|PHPDBG_IS_COLOURED) diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index dc41e2498f..48ccc19753 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -1210,8 +1210,9 @@ zend_vm_enter: } while(!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING));\ } while(0) - /* allow conditional breakpoints to access the vm uninterrupted */ - if (PHPDBG_G(flags) & PHPDBG_IN_COND_BP) { + /* allow conditional breakpoints and + initialization to access the vm uninterrupted */ + if (PHPDBG_G(flags) & PHPDBG_IN_COND_BP|PHPDBG_IS_INITIALIZING) { /* skip possible breakpoints */ goto next; } -- 2.40.0