"Unsetting old execution context: %s\n", PHPDBG_G(exec));
efree(PHPDBG_G(exec));
}
-
+
PHPDBG_G(exec) = estrndup(
expr, PHPDBG_G(exec_len)=expr_len);
-
+
printf(
"Set execution context: %s\n", PHPDBG_G(exec));
} /* }}} */
static PHPDBG_COMMAND(quit) /* {{{ */
{
zend_bailout();
-
+
return SUCCESS;
} /* }}} */
}
}
printf("Please report bugs to <http://theman.in/themoon>\n");
-
+
return SUCCESS;
} /* }}} */
static const phpdbg_command_t phpdbg_prompt_commands[] = {
- PHPDBG_COMMAND_D(exec, "set execution context"),
- PHPDBG_COMMAND_D(print, "print something"),
+ PHPDBG_COMMAND_D(exec, "set execution context"),
+ PHPDBG_COMMAND_D(print, "print something"),
PHPDBG_COMMAND_D(brake, "set brake point"),
PHPDBG_COMMAND_D(help, "show help menu"),
PHPDBG_COMMAND_D(quit, "exit phpdbg"),
char *params = NULL;
const char *cmd = strtok_r(cmd_line, " ", ¶ms);
size_t expr_len = cmd != NULL ? strlen(cmd) : 0;
-
+
while (command && command->name) {
if (command->name_len == expr_len
&& memcmp(cmd, command->name, expr_len) == 0) {
while (cmd[cmd_len] == '\n') {
cmd[cmd_len] = 0;
}
-
+
if (cmd_len) {
if (phpdbg_do_cmd(phpdbg_prompt_commands, cmd, cmd_len TSRMLS_CC) == FAILURE) {
printf("error executing %s !\n", cmd);
}
}
-
+
printf("phpdbg> ");
}
} /* }}} */
#define PHPDBG_COMMAND(name) \
int phpdbg_do_##name(const char *expr, size_t expr_len TSRMLS_DC)
-void phpdbg_interactive(int argc, char** argv TSRMLS_DC);
+void phpdbg_interactive(int argc, char **argv TSRMLS_DC);
#endif /* PHPDBG_PROMPT_H */