Browse Source

consistent in ___ for info/print

pull/550/head
krakjoe 13 years ago
parent
commit
0f8c4630f2
  1. 3
      .phpdbginit
  2. 23
      phpdbg_info.c
  3. 26
      phpdbg_print.c
  4. 3
      test.php

3
.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

23
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");

26
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!");
}

3
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+");

Loading…
Cancel
Save