} /* }}} */
PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack, char **why TSRMLS_DC) {
- if (command && command->args) {
+ if (command) {
char buffer[128] = {0,};
const phpdbg_param_t *top = (stack != NULL) ? *stack : NULL;
const char *arg = command->args;
zend_bool optional = 0;
/* check for arg spec */
- if (!(arg) || !(*arg))
- return SUCCESS;
+ if (!(arg) || !(*arg)) {
+ if (!top) {
+ return SUCCESS;
+ }
+
+ asprintf(why,
+ "%s expected no arguments",
+ phpdbg_command_name(command, buffer));
+ return FAILURE;
+ }
least = 0L;
PHPDBG_COMMAND_D(finish, "continue past the end of the stack", 'F', NULL, 0),
PHPDBG_COMMAND_D(leave, "continue until the end of the stack", 'L', NULL, 0),
PHPDBG_COMMAND_D(print, "print something", 'p', phpdbg_print_commands, "s"),
- PHPDBG_COMMAND_D(break, "set breakpoint", 'b', phpdbg_break_commands, 0),
+ PHPDBG_COMMAND_D(break, "set breakpoint", 'b', phpdbg_break_commands, "*|c"),
PHPDBG_COMMAND_D(back, "show trace", 't', NULL, "|n"),
PHPDBG_COMMAND_D(frame, "switch to a frame", 'f', NULL, "|n"),
PHPDBG_COMMAND_D(list, "lists some code", 'l', phpdbg_list_commands, "*"),
PHPDBG_COMMAND_D(set, "set phpdbg configuration", 'S', phpdbg_set_commands, "s"),
PHPDBG_COMMAND_D(register,"register a function", 'R', NULL, "s"),
PHPDBG_COMMAND_D(source, "execute a phpdbginit", '.', NULL, "s"),
- PHPDBG_COMMAND_D(shell, "shell a command", '-', NULL, 0),
+ PHPDBG_COMMAND_D(shell, "shell a command", '-', NULL, "i"),
PHPDBG_COMMAND_D(quit, "exit phpdbg", 'q', NULL, 0),
PHPDBG_END_COMMAND
}; /* }}} */