1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 12:42:29 +02:00

step through eval option

This commit is contained in:
krakjoe
2013-11-20 17:01:37 +00:00
parent 6d0991bad6
commit fdddde0d03
4 changed files with 22 additions and 9 deletions

View File

@@ -62,6 +62,7 @@ The following switches change the default behaviour of phpdbg:
- -O set oplog output file
- -q do not print banner on startup
- -r jump straight to run
- -E enable step through eval()
*Note: passing -rr will cause phpdbg to quit after execution, rather than returning to the console*

View File

@@ -393,6 +393,7 @@ const opt_struct OPTIONS[] = { /* {{{ */
{'I', 0, "ignore init"},
{'O', 1, "opline log"},
{'r', 0, "run"},
{'E', 0, "step-through-eval"},
{'-', 0, NULL}
}; /* }}} */
@@ -569,6 +570,10 @@ phpdbg_main:
case 's': /* set stepping on */
step = 1;
break;
case 'E': /* stepping through eval on */
flags |= PHPDBG_IS_STEPONEVAL;
break;
case 'b': /* set colours off */
flags &= ~PHPDBG_IS_COLOURED;

View File

@@ -97,6 +97,7 @@
#define PHPDBG_SEEK_MASK (PHPDBG_IN_UNTIL|PHPDBG_IN_FINISH|PHPDBG_IN_LEAVE)
#define PHPDBG_IS_REGISTERED (1<<16)
#define PHPDBG_IS_STEPONEVAL (1<<17)
#ifndef _WIN32
# define PHPDBG_DEFAULT_FLAGS (PHPDBG_IS_QUIET|PHPDBG_IS_COLOURED)

View File

@@ -489,7 +489,9 @@ PHPDBG_COMMAND(eval) /* {{{ */
zval retval;
char *code = NULL;
PHPDBG_G(flags) &= ~ PHPDBG_IS_STEPPING;
if (!(PHPDBG_G(flags) & PHPDBG_IS_STEPONEVAL)) {
PHPDBG_G(flags) &= ~ PHPDBG_IS_STEPPING;
}
if (input && input->start) {
code = (char*) input->start;
@@ -516,7 +518,8 @@ PHPDBG_COMMAND(eval) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IN_EVAL;
/* switch stepping back on */
if (stepping) {
if (stepping &&
!(PHPDBG_G(flags) & PHPDBG_IS_STEPONEVAL)) {
PHPDBG_G(flags) |= PHPDBG_IS_STEPPING;
}
@@ -869,6 +872,7 @@ PHPDBG_COMMAND(help) /* {{{ */
phpdbg_writeln(" -I\tN/A\t\t\tIgnore default .phpdbginit");
phpdbg_writeln(" -O\t-Omy.oplog\t\tSets oplog output file");
phpdbg_writeln(" -r\tN/A\t\t\tRun execution context");
phpdbg_writeln(" -E\tN/A\t\t\tEnable step through eval, careful !");
phpdbg_notice(
"Note: passing -rr will cause phpdbg to quit after execution");
phpdbg_help_footer();
@@ -1184,13 +1188,15 @@ zend_vm_enter:
#endif
#define DO_INTERACTIVE() do {\
phpdbg_list_file(\
zend_get_executed_filename(TSRMLS_C), \
3, \
zend_get_executed_lineno(TSRMLS_C)-1, \
zend_get_executed_lineno(TSRMLS_C) \
TSRMLS_CC\
);\
if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {\
phpdbg_list_file(\
zend_get_executed_filename(TSRMLS_C), \
3, \
zend_get_executed_lineno(TSRMLS_C)-1, \
zend_get_executed_lineno(TSRMLS_C) \
TSRMLS_CC\
);\
}\
\
do {\
switch (phpdbg_interactive(TSRMLS_C)) {\