printf("Pre-compilation of the execution context provides the opportunity to inspect the opcodes before they are executed\n");
printf("The execution context must be set for compilation to succeed\n");
printf("If errors occur during compilation they must be resolved before execution can take place.\n");
+ printf("It is a good idea to clean the environment between each compilation with the clean command\n");
printf("You do not need to exit phpdbg to retry compilation\n");
return SUCCESS;
} /* }}} */
printf("Setting a breakpoint stops execution at a specific stage, the syntax is:\n");
printf("\tfile:line\n");
printf("\tfunction\n");
- printf("\t0x12345678\n");
+ printf("\t0x16\n");
printf("For example:\n");
printf("\tphpdbg> break test.php:1\n");
printf("Will break execution on line 1 of test.php\n");
printf("\tphpdbg> break my_function\n");
printf("Will break execution on entry to my_function\n");
- printf("\tphpdbg> break 0x4c79a40\n");
- printf("Will break at the opline with the address provided\n");
+ printf("\tphpdbg> break 0x7ff68f570e08\n");
+ printf("Will break at the opline with the address provided (addresses are shown during execution)\n");
return SUCCESS;
} /* }}} */
return SUCCESS;
} /* }}} */
+PHPDBG_HELP(clear) /* {{{ */
+{
+ printf("Clearing breakpoints means you can once again run code without interruption\n");
+ printf("Careful though, all breakpoints are lost; be sure debugging is complete before clearing\n");
+ return SUCCESS;
+} /* }}} */
+
PHPDBG_HELP(quiet) /* {{{ */
{
printf("Setting quietness on will stop the OPLINE output during execution\n");
PHPDBG_HELP(print);
PHPDBG_HELP(break);
PHPDBG_HELP(clean);
+PHPDBG_HELP(clear);
PHPDBG_HELP(back);
PHPDBG_HELP(quiet);
PHPDBG_HELP_D(print, "printing allows inspection of the execution environment"),
PHPDBG_HELP_D(break, "breakpoints allow execution interruption"),
PHPDBG_HELP_D(clean, "resetting the environment is useful while debugging and recompiling"),
+ PHPDBG_HELP_D(clear, "clearing breakpoints allows you to run code without interruption"),
PHPDBG_HELP_D(back, "show debug backtrace information during execution"),
PHPDBG_HELP_D(quiet, "be quiet during execution"),
{NULL, 0, 0}
return SUCCESS;
} /* }}} */
+static PHPDBG_COMMAND(clear) /* {{{ */
+{
+ printf("Clearing Breakpoints:\n");
+ printf("\tFile\t%d\n", zend_hash_num_elements(&PHPDBG_G(bp_files)));
+ printf("\tSymbols\t%d\n", zend_hash_num_elements(&PHPDBG_G(bp_symbols)));
+ printf("\tOplines\t%d\n", zend_hash_num_elements(&PHPDBG_G(bp_oplines)));
+
+ zend_hash_clean(&PHPDBG_G(bp_files));
+ zend_hash_clean(&PHPDBG_G(bp_symbols));
+ zend_hash_clean(&PHPDBG_G(bp_oplines));
+
+ return SUCCESS;
+} /* }}} */
+
static PHPDBG_COMMAND(help) /* {{{ */
{
printf("Welcome to phpdbg, the interactive PHP debugger.\n");
PHPDBG_COMMAND_D(break, "set breakpoint"),
PHPDBG_COMMAND_D(back, "show backtrace"),
PHPDBG_COMMAND_D(clean, "clean the execution environment"),
+ PHPDBG_COMMAND_D(clear, "clear breakpoints"),
PHPDBG_COMMAND_D(help, "show help menu"),
PHPDBG_COMMAND_D(quiet, "silence some output"),
PHPDBG_COMMAND_D(quit, "exit phpdbg"),