com php-src: ...: phpdbg_help.c phpdbg_help.h phpdb g_prompt.c
| From: | Bob Weinand | Date: | Mon, 11 Nov 2013 13:31:41 +0000 |
| Subject: | com php-src: ...: phpdbg_help.c phpdbg_help.h phpdb g_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75139@lists.php.net to get a copy of this message | ||
Commit: 207e54a1c5c32c71ef8fe0a036f105b9286d1f4f
Author: krakjoe <joe.watkins@live.co.uk> Mon, 11 Nov 2013 13:31:41 +0000
Parents: be460647ef869b602ca3cd98ae2560446547500f
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=207e54a1c5c32c71ef8fe0a036f105b9286d1f4f
Log:
..
Changed paths:
M phpdbg_help.c
M phpdbg_help.h
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_help.c b/phpdbg_help.c
index 9fbd7bd..711dffa 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 b48409f..449f4d1 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 5f8c56a..abc2b7f 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"),