diff options
-rw-r--r-- | phpdbg.h | 2 | ||||
-rw-r--r-- | phpdbg_help.c | 14 | ||||
-rw-r--r-- | phpdbg_prompt.c | 6 | ||||
-rw-r--r-- | phpdbg_set.c | 30 | ||||
-rw-r--r-- | phpdbg_set.h | 1 |
5 files changed, 45 insertions, 8 deletions
@@ -140,6 +140,7 @@ #define PHPDBG_IS_DISCONNECTED (1<<27) #define PHPDBG_SHOW_REFCOUNTS (1<<28) +#define PHPDBG_STEP_OPCODE (1<<29) #define PHPDBG_SEEK_MASK (PHPDBG_IN_UNTIL|PHPDBG_IN_FINISH|PHPDBG_IN_LEAVE) #define PHPDBG_BP_RESOLVE_MASK (PHPDBG_HAS_FUNCTION_OPLINE_BP|PHPDBG_HAS_METHOD_OPLINE_BP|PHPDBG_HAS_FILE_OPLINE_BP) @@ -200,6 +201,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) phpdbg_command_t *lcmd; /* last command */ phpdbg_param_t lparam; /* last param */ + zend_ulong lline; /* last line */ zend_ulong flags; /* phpdbg flags */ ZEND_END_MODULE_GLOBALS(phpdbg) /* }}} */ diff --git a/phpdbg_help.c b/phpdbg_help.c index 4866f1e67e..2a6f9e82b6 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -800,12 +800,13 @@ phpdbg_help_text_t phpdbg_help_text[] = { " **Type** **Alias** **Purpose**" CR " **prompt** **p** set the prompt" CR " **color** **c** set color <element> <color>" CR -" **colors** **C** set colors <on|off>" CR -" **oplog** **O** set oplog output" CR +" **colors** **C** set colors [<on|off>]" CR +" **oplog** **O** set oplog [output]" CR " **break** **b** set break **id** <on|off>" CR -" **breaks** **B** set breaks <on|off>" CR -" **quiet** **q** set quiet <on|off>" CR -" **refcount** **r** set refcount <on|off> (refcount display upon hit watchpoint)" CR CR +" **breaks** **B** set breaks [<on|off>]" CR +" **quiet** **q** set quiet [<on|off>]" CR +" **stepping** **s** set stepping [<opcode|line>]" CR +" **refcount** **r** set refcount [<on|off>] " CR CR "Valid colors are **none**, **white**, **red**, **green**, **yellow**, **blue**, **purple**, " "**cyan** and **black**. All colours except **none** can be followed by an optional " @@ -824,6 +825,9 @@ phpdbg_help_text_t phpdbg_help_text[] = { " $P S c error red-bold" CR " Use red bold for errors" CR CR +" $P S refcount on" CR +" Enable refcount display when hitting watchpoints" CR CR + " $P S b 4 off" CR " Temporarily disable breakpoint 4. This can be subsequently reenabled by a **s b 4 on**." CR //*********** check oplog syntax diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 1b1cb25215..b8df289687 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -1230,6 +1230,7 @@ zend_vm_enter: #endif #define DO_INTERACTIVE() do { \ + PHPDBG_G(lline) = zend_get_executed_lineno(TSRMLS_C);\ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { \ phpdbg_list_file( \ zend_get_executed_filename(TSRMLS_C), \ @@ -1331,7 +1332,10 @@ zend_vm_enter: } if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) { - DO_INTERACTIVE(); + if ((PHPDBG_G(flags) & PHPDBG_STEP_OPCODE) || + (execute_data->opline->lineno != PHPDBG_G(lline))) { + DO_INTERACTIVE(); + } } next: diff --git a/phpdbg_set.c b/phpdbg_set.c index aeb882657e..54269a8193 100644 --- a/phpdbg_set.c +++ b/phpdbg_set.c @@ -40,6 +40,7 @@ const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET_COMMAND_D(break, "usage: set break id [<on|off>]", 'b', set_break, NULL, "l|b"), PHPDBG_SET_COMMAND_D(breaks, "usage: set breaks [<on|off>]", 'B', set_breaks, NULL, "|b"), PHPDBG_SET_COMMAND_D(quiet, "usage: set quiet [<on|off>]", 'q', set_quiet, NULL, "|b"), + PHPDBG_SET_COMMAND_D(stepping, "usage: set stepping [<line|op>]", 's', set_stepping, NULL, "|s"), PHPDBG_SET_COMMAND_D(refcount, "usage: set refcount [<on|off>]", 'r', set_refcount, NULL, "|b"), PHPDBG_END_COMMAND }; @@ -196,7 +197,8 @@ PHPDBG_SET(oplog) /* {{{ */ PHPDBG_SET(quiet) /* {{{ */ { if (!param || param->type == EMPTY_PARAM) { - phpdbg_writeln("Quietness %s", PHPDBG_G(flags) & PHPDBG_IS_QUIET ? "on" : "off"); + phpdbg_writeln("Quietness %s", + PHPDBG_G(flags) & PHPDBG_IS_QUIET ? "on" : "off"); } else switch (param->type) { case NUMERIC_PARAM: { if (param->num) { @@ -212,10 +214,34 @@ PHPDBG_SET(quiet) /* {{{ */ return SUCCESS; } /* }}} */ +PHPDBG_SET(stepping) /* {{{ */ +{ + if (!param || param->type == EMPTY_PARAM) { + phpdbg_writeln("Stepping %s", + PHPDBG_G(flags) & PHPDBG_STEP_OPCODE ? "opcode" : "line"); + } else switch (param->type) { + case STR_PARAM: { + if ((param->len == sizeof("opcode")-1) && + (memcmp(param->str, "opcode", sizeof("opcode")) == SUCCESS)) { + PHPDBG_G(flags) |= PHPDBG_STEP_OPCODE; + } else if ((param->len == sizeof("line")-1) && + (memcmp(param->str, "line", sizeof("line")) == SUCCESS)) { + PHPDBG_G(flags) &= ~PHPDBG_STEP_OPCODE; + } else { + phpdbg_error("usage set stepping [<opcode|line>]"); + } + } break; + + phpdbg_default_switch_case(); + } + + return SUCCESS; +} /* }}} */ + PHPDBG_SET(refcount) /* {{{ */ { if (!param || param->type == EMPTY_PARAM) { - phpdbg_writeln("Showing refcounts on watchpoints %s", PHPDBG_G(flags) & PHPDBG_IS_QUIET ? "on" : "off"); + phpdbg_writeln("Refcount %s", PHPDBG_G(flags) & PHPDBG_IS_QUIET ? "on" : "off"); } else switch (param->type) { case NUMERIC_PARAM: { if (param->num) { diff --git a/phpdbg_set.h b/phpdbg_set.h index 67bf4cd7de..dea61ed382 100644 --- a/phpdbg_set.h +++ b/phpdbg_set.h @@ -34,6 +34,7 @@ PHPDBG_SET(oplog); PHPDBG_SET(break); PHPDBG_SET(breaks); PHPDBG_SET(quiet); +PHPDBG_SET(stepping); PHPDBG_SET(refcount); extern const phpdbg_command_t phpdbg_set_commands[]; |