]> granicus.if.org Git - php/commitdiff
...
authorkrakjoe <joe.watkins@live.co.uk>
Mon, 11 Nov 2013 13:31:41 +0000 (13:31 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Mon, 11 Nov 2013 13:31:41 +0000 (13:31 +0000)
phpdbg_help.c
phpdbg_help.h
phpdbg_prompt.c

index 9fbd7bd1379f7f77a31a6266a4abfe9875f3c474..711dffa74a71f287dad5e3be92cf30a707625a1f 100644 (file)
@@ -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");
index b48409f487e186b9c1af5622438a57a8212ce1d9..449f4d1c5860ec020681e3560bf15e58a5246766 100644 (file)
@@ -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}
index 5f8c56a0c5dd626e2de519d641071d7597831f81..abc2b7fc775e7e0ca79cdc6e71773bbeb80a2740 100644 (file)
@@ -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"),