diff --git a/phpdbg.h b/phpdbg.h index 615af577f1c..81a81da97ae 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -121,25 +121,26 @@ #define PHPDBG_IN_EVAL (1<<11) #define PHPDBG_IS_STEPPING (1<<12) -#define PHPDBG_IS_QUIET (1<<13) -#define PHPDBG_IS_QUITTING (1<<14) -#define PHPDBG_IS_COLOURED (1<<15) -#define PHPDBG_IS_CLEANING (1<<16) +#define PHPDBG_IS_OPLINE_STEPPING (1<<13) +#define PHPDBG_IS_QUIET (1<<14) +#define PHPDBG_IS_QUITTING (1<<15) +#define PHPDBG_IS_COLOURED (1<<16) +#define PHPDBG_IS_CLEANING (1<<17) -#define PHPDBG_IN_UNTIL (1<<17) -#define PHPDBG_IN_FINISH (1<<18) -#define PHPDBG_IN_LEAVE (1<<19) +#define PHPDBG_IN_UNTIL (1<<18) +#define PHPDBG_IN_FINISH (1<<19) +#define PHPDBG_IN_LEAVE (1<<20) -#define PHPDBG_IS_REGISTERED (1<<20) -#define PHPDBG_IS_STEPONEVAL (1<<21) -#define PHPDBG_IS_INITIALIZING (1<<22) -#define PHPDBG_IS_SIGNALED (1<<23) -#define PHPDBG_IS_INTERACTIVE (1<<24) -#define PHPDBG_IS_BP_ENABLED (1<<25) -#define PHPDBG_IS_REMOTE (1<<26) -#define PHPDBG_IS_DISCONNECTED (1<<27) +#define PHPDBG_IS_REGISTERED (1<<21) +#define PHPDBG_IS_STEPONEVAL (1<<22) +#define PHPDBG_IS_INITIALIZING (1<<23) +#define PHPDBG_IS_SIGNALED (1<<24) +#define PHPDBG_IS_INTERACTIVE (1<<25) +#define PHPDBG_IS_BP_ENABLED (1<<26) +#define PHPDBG_IS_REMOTE (1<<27) +#define PHPDBG_IS_DISCONNECTED (1<<28) -#define PHPDBG_SHOW_REFCOUNTS (1<<28) +#define PHPDBG_SHOW_REFCOUNTS (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) diff --git a/phpdbg_help.c b/phpdbg_help.c index a00f445638b..74c59df4a6d 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -318,30 +318,29 @@ phpdbg_help_text_t phpdbg_help_text[] = { "**Information**" CR " **list** list PHP source" CR " **info** displays information on the debug session" CR -" **help** provide help on a topic" CR -" **print** print argument " CR -" **frame** select a stack frame and print a stack frame summary" CR CR +" **print** show opcodes " CR +" **frame** select a stack frame and print a stack frame summary" CR +" **help** provide help on a topic" CR CR "**Starting and Stopping Execution**" CR " **exec** set execution context" CR " **run** attempt execution" CR " **step** continue execution until other line is reached" CR -" **next** continue execution" CR +" **continue** continue execution" CR " **until** continue execution up to the given location" CR " **finish** continue up to end of the current execution frame" CR " **leave** continue up to end of the current execution frame and halt after the calling instruction" CR " **break** set a breakpoint at the specified target" CR " **watch** set a watchpoint on $variable" CR -" **ev** evaluate some code" CR " **clear** clear one or all breakpoints" CR " **clean** clean the execution environment" CR CR "**Miscellaneous**" CR -" **quiet** silence some output" CR " **set** set the phpdbg configuration" CR " **source** execute a phpdbginit script" CR " **register** register a phpdbginit function as a command alias" CR " **sh** shell a command" CR +" **ev** evaluate some code" CR " **quit** exit phpdbg" CR CR "Type **help ** or (**help alias**) to get detailed help on any of the above commands, " @@ -714,12 +713,12 @@ phpdbg_help_text_t phpdbg_help_text[] = { }, //*********** what is the difference between n and s ??? -{"next", -"The **next** command causes control to be passed back to the vm, continuing execution. The next " -"opline will be executed if **step 1** is set. Otherwise execution will continue to the next " +{"continue", +"The **continue** command causes control to be passed back to the vm, continuing execution. The next " +"opline will be executed if **step** is set **on**. Otherwise execution will continue to the next " "breakpoint or script completion" CR CR -"Note **next** will trigger a \"not running\" error if not executing." +"Note **continue** will trigger a \"not running\" error if not executing." }, {"print", @@ -807,6 +806,7 @@ phpdbg_help_text_t phpdbg_help_text[] = { " **break** **b** set break **id** " CR " **breaks** **B** set breaks " CR " **quiet** **q** set quiet " CR +" **step** **s** step opcode-by-opcode " CR " **refcount** **r** set refcount (refcount display upon hit watchpoint)" CR CR "Valid colors are **none**, **white**, **red**, **green**, **yellow**, **blue**, **purple**, " diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 6eb7481c5ec..fe2d7177efc 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -44,7 +44,7 @@ int yyparse(phpdbg_param_t *stack, yyscan_t scanner); 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, 0), - PHPDBG_COMMAND_D(next, "continue execution", 'n', NULL, 0), + PHPDBG_COMMAND_D(continue,"continue execution", 'c', NULL, 0), PHPDBG_COMMAND_D(run, "attempt execution", 'r', NULL, "|s"), PHPDBG_COMMAND_D(ev, "evaluate some code", 0, NULL, "i"), PHPDBG_COMMAND_D(until, "continue past the current line", 'u', NULL, 0), @@ -429,7 +429,7 @@ PHPDBG_COMMAND(step) /* {{{ */ return PHPDBG_NEXT; } /* }}} */ -PHPDBG_COMMAND(next) /* {{{ */ +PHPDBG_COMMAND(continue) /* {{{ */ { return PHPDBG_NEXT; } /* }}} */ diff --git a/phpdbg_prompt.h b/phpdbg_prompt.h index 51efffa0d3f..ef648aabeb0 100644 --- a/phpdbg_prompt.h +++ b/phpdbg_prompt.h @@ -30,9 +30,8 @@ void phpdbg_clean(zend_bool full TSRMLS_DC); /* }}} */ /* {{{ phpdbg command handlers */ PHPDBG_COMMAND(exec); -PHPDBG_COMMAND(compile); PHPDBG_COMMAND(step); -PHPDBG_COMMAND(next); +PHPDBG_COMMAND(continue); PHPDBG_COMMAND(run); PHPDBG_COMMAND(ev); PHPDBG_COMMAND(until); diff --git a/phpdbg_set.c b/phpdbg_set.c index aeb882657eb..888da8f77db 100644 --- a/phpdbg_set.c +++ b/phpdbg_set.c @@ -36,6 +36,7 @@ const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET_COMMAND_D(color, "usage: set color ", 'c', set_color, NULL, "ss"), PHPDBG_SET_COMMAND_D(colors, "usage: set colors []", 'C', set_colors, NULL, "|b"), #endif + PHPDBG_SET_COMMAND_D(step, "usage: set oplog []", 'O', set_oplog, NULL, "|s"), PHPDBG_SET_COMMAND_D(break, "usage: set break id []", 'b', set_break, NULL, "l|b"), PHPDBG_SET_COMMAND_D(breaks, "usage: set breaks []", 'B', set_breaks, NULL, "|b"), @@ -100,6 +101,20 @@ 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) /* {{{ */ { diff --git a/phpdbg_set.h b/phpdbg_set.h index 67bf4cd7def..555a91f1854 100644 --- a/phpdbg_set.h +++ b/phpdbg_set.h @@ -26,6 +26,7 @@ #define PHPDBG_SET(name) PHPDBG_COMMAND(set_##name) PHPDBG_SET(prompt); +PHPDBG_SET(step); #ifndef _WIN32 PHPDBG_SET(color); PHPDBG_SET(colors);