diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-06-29 01:41:04 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-06-29 01:41:04 +0200 |
commit | 5e16722309354a9750ea68e6951fb25a23158923 (patch) | |
tree | e6ce827fc3ad7e3e2a32b4fc671474e403d8d81c /sapi/phpdbg/phpdbg_prompt.c | |
parent | 79b1832dd5086cd9b4a2e778a62f1743b548726c (diff) | |
download | php-git-5e16722309354a9750ea68e6951fb25a23158923.tar.gz |
Show exception source in phpdbg
Diffstat (limited to 'sapi/phpdbg/phpdbg_prompt.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_prompt.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 3b1ec1f19a..fc63c32fa3 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -1443,6 +1443,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */ /* check for uncaught exceptions */ if (exception && PHPDBG_G(handled_exception) != exception) { zend_execute_data *prev_ex = execute_data; + zval zv, rv; + zend_string *file; + zend_long line; do { prev_ex = zend_generator_check_placeholder_frame(prev_ex); @@ -1457,7 +1460,13 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */ } while ((prev_ex = prev_ex->prev_execute_data)); PHPDBG_G(handled_exception) = exception; - phpdbg_error("exception", "name=\"%s\"", "Uncaught exception %s", exception->ce->name->val); + + ZVAL_OBJ(&zv, exception); + file = zval_get_string(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("file"), 1, &rv)); + line = zval_get_long(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("line"), 1, &rv)); + + phpdbg_error("exception", "name=\"%s\" file=\"%s\" line=\"%lld\"", "Uncaught exception %s in %s on line %lld", exception->ce->name->val, file->val, line); + zend_string_release(file); DO_INTERACTIVE(1); } ex_is_caught: |