diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-20 16:47:24 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-20 16:47:24 +0200 |
commit | e097919f160391c23d93d3ad9a94a505d7c230d8 (patch) | |
tree | 1b7da2c62cab3753a5b1e457cb1d910b029ec8c9 /phpdbg_prompt.c | |
parent | d21d5c98a53ddedc3e15d53f8dbe5d71eb06417e (diff) | |
download | php-git-e097919f160391c23d93d3ad9a94a505d7c230d8.tar.gz |
Stepping is now line by line with gdb style command
Diffstat (limited to 'phpdbg_prompt.c')
-rw-r--r-- | phpdbg_prompt.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index dcbd2ba327..6eb7481c5e 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -43,7 +43,7 @@ int yyparse(phpdbg_param_t *stack, yyscan_t scanner); /* {{{ command declarations */ const phpdbg_command_t phpdbg_prompt_commands[] = { PHPDBG_COMMAND_D(exec, "set execution context", 'e', NULL, "s"), - PHPDBG_COMMAND_D(step, "step through execution", 's', NULL, "b"), + PHPDBG_COMMAND_D(step, "step through execution", 's', NULL, 0), PHPDBG_COMMAND_D(next, "continue execution", 'n', NULL, 0), PHPDBG_COMMAND_D(run, "attempt execution", 'r', NULL, "|s"), PHPDBG_COMMAND_D(ev, "evaluate some code", 0, NULL, "i"), @@ -424,16 +424,9 @@ int phpdbg_compile(TSRMLS_D) /* {{{ */ PHPDBG_COMMAND(step) /* {{{ */ { - if (param->num) { - PHPDBG_G(flags) |= PHPDBG_IS_STEPPING; - } else { - PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING; - } + PHPDBG_G(flags) |= PHPDBG_IS_STEPPING; - phpdbg_notice("Stepping %s", - (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ? "on" : "off"); - - return SUCCESS; + return PHPDBG_NEXT; } /* }}} */ PHPDBG_COMMAND(next) /* {{{ */ @@ -1314,6 +1307,11 @@ zend_vm_enter: phpdbg_print_opline_ex( execute_data, &vars, 0 TSRMLS_CC); + if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && execute_data->opline->lineno != PHPDBG_G(last_line)) { + PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING; + DO_INTERACTIVE(); + } + /* check if some watchpoint was hit */ { if (phpdbg_print_changed_zvals(TSRMLS_C) == SUCCESS) { @@ -1333,10 +1331,6 @@ zend_vm_enter: } } - if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) { - DO_INTERACTIVE(); - } - next: if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) { phpdbg_writeln(EMPTY); |