- -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*
{'I', 0, "ignore init"},
{'O', 1, "opline log"},
{'r', 0, "run"},
+ {'E', 0, "step-through-eval"},
{'-', 0, NULL}
}; /* }}} */
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;
#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)
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;
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;
}
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();
#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)) {\