Commit: 0f8c4630f25aeb1639190cd3f9460862dd00ce8d Author: krakjoe <joe.watk...@live.co.uk> Mon, 25 Nov 2013 10:17:57 +0000 Parents: 23188834463ec6a459c7743b80ac588e90ab20e5 Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0f8c4630f25aeb1639190cd3f9460862dd00ce8d Log: consistent in ___ for info/print Changed paths: M .phpdbginit M phpdbg_info.c M phpdbg_print.c M test.php Diff: diff --git a/.phpdbginit b/.phpdbginit index 6e059d7..1ad3521 100644 --- a/.phpdbginit +++ b/.phpdbginit @@ -7,6 +7,9 @@ # Place initialization commands one per line ########################################################## # exec sapi/phpdbg/test.php +# set color prompt white-bold +# set color notice green +# set color error red ########################################################## # Embedding code in .phpdbginit diff --git a/phpdbg_info.c b/phpdbg_info.c index 51e3a33..721778d 100644 --- a/phpdbg_info.c +++ b/phpdbg_info.c @@ -95,8 +95,27 @@ PHPDBG_INFO(vars) /* {{{ */ zend_hash_move_forward_ex(EG(active_symbol_table), &pos); } - phpdbg_notice("Variables: %d", - zend_hash_num_elements(&vars)); + { + zend_op_array *ops = EG(active_op_array); + + if (ops->function_name) { + if (ops->scope) { + phpdbg_notice( + "Variables in %s::%s() (%d)", ops->scope->name, ops->function_name, zend_hash_num_elements(&vars)); + } else { + phpdbg_notice( + "Variables in %s() (%d)", ops->function_name, zend_hash_num_elements(&vars)); + } + } else { + if (ops->filename) { + phpdbg_notice( + "Variables in %s (%d)", ops->filename, zend_hash_num_elements(&vars)); + } else { + phpdbg_notice( + "Variables @ %p (%d)", ops, zend_hash_num_elements(&vars)); + } + } + } if (zend_hash_num_elements(&vars)) { phpdbg_writeln("Address\t\tRefs\tType\t\tVariable"); diff --git a/phpdbg_print.c b/phpdbg_print.c index e4ee5f9..4170059 100644 --- a/phpdbg_print.c +++ b/phpdbg_print.c @@ -117,12 +117,28 @@ PHPDBG_PRINT(exec) /* {{{ */ PHPDBG_PRINT(stack) /* {{{ */ { - if (EG(in_execution) && EG(active_op_array)) { - phpdbg_notice( - "Stack in %s", zend_get_executed_filename(TSRMLS_C)); - + zend_op_array *ops = EG(active_op_array); + + if (EG(in_execution) && ops) { + if (ops->function_name) { + if (ops->scope) { + phpdbg_notice( + "Stack in %s::%s()", ops->scope->name, ops->function_name); + } else { + phpdbg_notice( + "Stack in %s()", ops->function_name); + } + } else { + if (ops->filename) { + phpdbg_notice( + "Stack in %s", ops->filename); + } else { + phpdbg_notice( + "Stack @ %p", ops); + } + } phpdbg_print_function_helper( - (zend_function*) EG(active_op_array) TSRMLS_CC); + (zend_function*) ops TSRMLS_CC); } else { phpdbg_error("Not Executing!"); } diff --git a/test.php b/test.php index 949f7c9..8ced95e 100644 --- a/test.php +++ b/test.php @@ -1,6 +1,7 @@ <?php -if (isset($include)) +if (isset($include)) { include (sprintf("%s/web-bootstrap.php", dirname(__FILE__))); +} $stdout = fopen("php://stdout", "w+"); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php