From: krakjoe Date: Mon, 25 Nov 2013 10:17:57 +0000 (+0000) Subject: consistent in ___ for info/print X-Git-Tag: php-5.6.0alpha1~110^2~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f8c4630f25aeb1639190cd3f9460862dd00ce8d;p=php consistent in ___ for info/print --- diff --git a/.phpdbginit b/.phpdbginit index 6e059d72e3..1ad35218ed 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 51e3a336ae..721778d638 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 e4ee5f95f1..4170059de2 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 949f7c9ada..8ced95e7a3 100644 --- a/test.php +++ b/test.php @@ -1,6 +1,7 @@