From 207e54a1c5c32c71ef8fe0a036f105b9286d1f4f Mon Sep 17 00:00:00 2001 From: krakjoe Date: Mon, 11 Nov 2013 13:31:41 +0000 Subject: [PATCH] ... --- phpdbg_help.c | 14 +++++++++++--- phpdbg_help.h | 2 ++ phpdbg_prompt.c | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/phpdbg_help.c b/phpdbg_help.c index 9fbd7bd137..711dffa74a 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -50,6 +50,7 @@ PHPDBG_HELP(compile) /* {{{ */ 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; } /* }}} */ @@ -83,14 +84,14 @@ PHPDBG_HELP(break) /* {{{ */ 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; } /* }}} */ @@ -101,6 +102,13 @@ PHPDBG_HELP(clean) /* {{{ */ 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"); diff --git a/phpdbg_help.h b/phpdbg_help.h index b48409f487..449f4d1c58 100644 --- a/phpdbg_help.h +++ b/phpdbg_help.h @@ -42,6 +42,7 @@ PHPDBG_HELP(eval); PHPDBG_HELP(print); PHPDBG_HELP(break); PHPDBG_HELP(clean); +PHPDBG_HELP(clear); PHPDBG_HELP(back); PHPDBG_HELP(quiet); @@ -58,6 +59,7 @@ static const phpdbg_command_t phpdbg_help_commands[] = { 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} diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 5f8c56a0c5..abc2b7fc77 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -363,6 +363,20 @@ static PHPDBG_COMMAND(clean) /* {{{ */ 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"); @@ -410,6 +424,7 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = { 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"), -- 2.40.0