From 57b67d71b0264143ba33d997eff918d34e8adc67 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Mon, 18 Nov 2013 11:51:41 +0000 Subject: [PATCH] display uncaught exceptions --- phpdbg_prompt.c | 15 ++++++++++++--- test.php | 1 - 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index e5cd87f1ac..c365345a9c 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -440,10 +440,19 @@ static PHPDBG_COMMAND(run) /* {{{ */ } } zend_end_try(); - EG(active_op_array) = orig_op_array; - EG(opline_ptr) = orig_opline; - EG(return_value_ptr_ptr) = orig_retval_ptr; + if (EG(exception)) { + phpdbg_error("Uncaught Exception !"); + /* + * @TODO(anyone) something better !! + */ + zend_print_zval_r( + EG(exception), 0 TSRMLS_CC); + } + EG(active_op_array) = orig_op_array; + EG(opline_ptr) = orig_opline; + EG(return_value_ptr_ptr) = orig_retval_ptr; + } else { phpdbg_error("Nothing to execute!"); } diff --git a/test.php b/test.php index 45aeb816cb..2266d157d5 100644 --- a/test.php +++ b/test.php @@ -1,5 +1,4 @@