diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2014-04-20 20:20:59 +0200 |
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2014-04-20 20:20:59 +0200 |
| commit | 577c6ed0ce9983967622d8b7086dab0a4978a148 (patch) | |
| tree | da58e9b24cb10c8beee75297230c72e858e0b7cd | |
| parent | 422dc49c0d02f8ff8903d42a91bf8a1316d62211 (diff) | |
| parent | f96feea00c112bc1bec3e7b677218f4b487d1152 (diff) | |
| download | php-git-577c6ed0ce9983967622d8b7086dab0a4978a148.tar.gz | |
Fixed stepping
| -rw-r--r-- | phpdbg.h | 2 | ||||
| -rw-r--r-- | phpdbg_help.c | 15 | ||||
| -rw-r--r-- | phpdbg_prompt.c | 2 | ||||
| -rw-r--r-- | phpdbg_set.c | 45 | ||||
| -rw-r--r-- | phpdbg_set.h | 2 |
5 files changed, 40 insertions, 26 deletions
@@ -121,7 +121,7 @@ #define PHPDBG_IN_EVAL (1<<11) #define PHPDBG_IS_STEPPING (1<<12) -#define PHPDBG_IS_OPLINE_STEPPING (1<<13) +#define PHPDBG_STEP_OPCODE (1<<13) #define PHPDBG_IS_QUIET (1<<14) #define PHPDBG_IS_QUITTING (1<<15) #define PHPDBG_IS_COLOURED (1<<16) diff --git a/phpdbg_help.c b/phpdbg_help.c index 74c59df4a6..39d8357dfc 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -801,13 +801,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 -" **step** **s** step opcode-by-opcode <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 " @@ -826,6 +826,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 fe2d7177ef..d93b55374e 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -1307,7 +1307,7 @@ 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)) { + if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING && (PHPDBG_G(flags) & PHPDBG_STEP_OPCODE || execute_data->opline->lineno != PHPDBG_G(last_line))) { PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING; DO_INTERACTIVE(); } diff --git a/phpdbg_set.c b/phpdbg_set.c index 888da8f77d..54269a8193 100644 --- a/phpdbg_set.c +++ b/phpdbg_set.c @@ -36,11 +36,11 @@ const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET_COMMAND_D(color, "usage: set color <element> <color>", 'c', set_color, NULL, "ss"), PHPDBG_SET_COMMAND_D(colors, "usage: set colors [<on|off>]", 'C', set_colors, NULL, "|b"), #endif - PHPDBG_SET_COMMAND_D(step, "usage: set oplog [<on|off]", 's', set_step, NULL, "|b"), PHPDBG_SET_COMMAND_D(oplog, "usage: set oplog [<output>]", 'O', set_oplog, NULL, "|s"), 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 }; @@ -101,20 +101,6 @@ PHPDBG_SET(breaks) /* {{{ */ return SUCCESS; } /* }}} */ -PHPDBG_SET(step) /* {{{ */ -{ - if (param->num) { - PHPDBG_G(flags) |= PHPDBG_IS_OPLINE_STEPPING; - } else { - PHPDBG_G(flags) &= ~PHPDBG_IS_OPLINE_STEPPING; - } - - phpdbg_notice("Stepping opcode-by-opcode %s", - (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ? "on" : "off"); - - return SUCCESS; -} /* }}} */ - #ifndef _WIN32 PHPDBG_SET(color) /* {{{ */ { @@ -211,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) { @@ -227,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 555a91f185..dea61ed382 100644 --- a/phpdbg_set.h +++ b/phpdbg_set.h @@ -26,7 +26,6 @@ #define PHPDBG_SET(name) PHPDBG_COMMAND(set_##name) PHPDBG_SET(prompt); -PHPDBG_SET(step); #ifndef _WIN32 PHPDBG_SET(color); PHPDBG_SET(colors); @@ -35,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[]; |
