Conflicts:
	phpdbg_help.c
	phpdbg_prompt.c
This commit is contained in:
Bob Weinand 2014-04-20 19:55:44 +02:00
commit 422dc49c0d
6 changed files with 46 additions and 30 deletions

View File

@ -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)

View File

@ -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 <command>** 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** <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
"Valid colors are **none**, **white**, **red**, **green**, **yellow**, **blue**, **purple**, "

View File

@ -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;
} /* }}} */

View File

@ -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);

View File

@ -36,6 +36,7 @@ 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"),
@ -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) /* {{{ */
{

View File

@ -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);