com php-src: housework: phpdbg.h phpdbg_bp.c phpdbg_hel p.c phpdbg_prompt.c phpdbg_utils.h
| From: | Bob Weinand | Date: | Tue, 12 Nov 2013 23:54:41 +0000 |
| Subject: | com php-src: housework: phpdbg.h phpdbg_bp.c phpdbg_hel p.c phpdbg_prompt.c phpdbg_utils.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75044@lists.php.net to get a copy of this message | ||
Commit: 52040263083b1ab748d850d0a614b8b8bd62ffc4
Author: krakjoe <joe.watkins@live.co.uk> Tue, 12 Nov 2013 23:54:41 +0000
Parents: a8285e3bbfb8685a36c370d1d39e435aa2871d96
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=52040263083b1ab748d850d0a614b8b8bd62ffc4
Log:
housework
Changed paths:
M phpdbg.h
M phpdbg_bp.c
M phpdbg_help.c
M phpdbg_prompt.c
M phpdbg_utils.h
Diff:
diff --git a/phpdbg.h b/phpdbg.h
index 9826c8b..063cce1 100644
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -101,17 +101,4 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
zend_ulong flags; /* phpdbg flags */
ZEND_END_MODULE_GLOBALS(phpdbg)
-/* {{{ colourful helpers */
-#define PHPDBG_RED_LINE(TSRMLS_D) \
- ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;31m[" : "[")
-#define PHPDBG_BOLD_LINE(TSRMLS_D) \
- ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64m[" : "[")
-#define PHPDBG_END_LINE(TSRMLS_D) \
- ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "]\033[0m" : "]")
-#define PHPDBG_PROMPT_LINE(TSRMLS_D) \
- ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64mphpdbg>\033[0m " :
"phpdbg> ")
-#define PHPDBG_SEP_LINE(TSRMLS_D) do {\
- printf("%s--------------------------------------%s\n", PHPDBG_BOLD_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));\
- } while(0) /* }}} */
-
#endif /* PHPDBG_H */
diff --git a/phpdbg_bp.c b/phpdbg_bp.c
index 45ecbc5..b4defa1 100644
--- a/phpdbg_bp.c
+++ b/phpdbg_bp.c
@@ -286,7 +286,7 @@ void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
HashPosition position;
phpdbg_breaksymbol_t *brake;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("Function Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM],
&position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], (void**)
&brake, &position) == SUCCESS;
@@ -303,7 +303,7 @@ void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
zend_uint class_len = 0;
zend_ulong class_idx = 0L;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("Method Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD],
&position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], (void**)
&class_table, &position[0]) == SUCCESS;
@@ -330,7 +330,7 @@ void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
HashPosition position;
zend_llist *points;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("File Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE],
&position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], (void**)
&points, &position) == SUCCESS;
@@ -350,7 +350,7 @@ void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */
HashPosition position;
phpdbg_breakline_t *brake;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("Opline Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE],
&position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (void**)
&brake, &position) == SUCCESS;
diff --git a/phpdbg_help.c b/phpdbg_help.c
index b49f45a..5750619 100644
--- a/phpdbg_help.c
+++ b/phpdbg_help.c
@@ -34,9 +34,11 @@ PHPDBG_HELP(exec) /* {{{ */
PHPDBG_HELP(step) /* {{{ */
{
phpdbg_writeln("You can enable and disable stepping at any phpdbg prompt during
execution");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("For example:");
phpdbg_writeln("\t%sstepping 1", PROMPT);
phpdbg_writeln("Will enable stepping");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("While stepping is enabled you are presented with a prompt after the
execution of each opcode");
return SUCCESS;
} /* }}} */
@@ -125,6 +127,7 @@ PHPDBG_HELP(clear) /* {{{ */
PHPDBG_HELP(quiet) /* {{{ */
{
phpdbg_writeln("Setting quietness on will stop the OPLINE output during execution");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("For example:");
phpdbg_writeln("\t%squiet 1", PROMPT);
phpdbg_writeln("Will silence OPLINE output, while");
@@ -136,6 +139,7 @@ PHPDBG_HELP(quiet) /* {{{ */
PHPDBG_HELP(back) /* {{{ */
{
phpdbg_writeln("The backtrace is gathered with the default debug_backtrace
functionality.");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("You can set the limit on the trace, for example:");
phpdbg_writeln("\t%sback 5", PROMPT);
phpdbg_writeln("Will limit the number of frames to 5, the default is no limit");
@@ -145,12 +149,14 @@ PHPDBG_HELP(back) /* {{{ */
PHPDBG_HELP(list) /* {{{ */
{
phpdbg_writeln("The list command displays N line from current context file.");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("\t%slist 2", PROMPT);
phpdbg_writeln("Will print next 2 lines from the current file");
phpdbg_writeln("\t%slist func", PROMPT);
phpdbg_writeln("Will print the source of the global function \"func\"");
phpdbg_writeln("\t%slist .mine", PROMPT);
phpdbg_writeln("Will print the source of the class method \"mine\"");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("Note: before listing functions you must have a populated function table, try
compile !!");
return SUCCESS;
} /* }}} */
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index fe1c326..f221b58 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -214,7 +214,7 @@ static PHPDBG_COMMAND(print) /* {{{ */
return SUCCESS;
}
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_notice("Execution Context Information:");
#ifdef HAVE_LIBREADLINE
phpdbg_writeln("Readline\tyes");
@@ -249,7 +249,7 @@ static PHPDBG_COMMAND(print) /* {{{ */
phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD TSRMLS_CC);
phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE TSRMLS_CC);
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
return SUCCESS;
} /* }}} */
@@ -553,7 +553,7 @@ phpdbg_interactive_enter:
phpdbg_interactive_enter:
while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
- cmd = readline(PHPDBG_PROMPT_LINE(TSRMLS_C));
+ cmd = readline(PROMPT);
cmd_len = strlen(cmd);
#endif
diff --git a/phpdbg_utils.h b/phpdbg_utils.h
index e51462c..7682201 100644
--- a/phpdbg_utils.h
+++ b/phpdbg_utils.h
@@ -20,8 +20,6 @@
#ifndef PHPDBG_UTILS_H
#define PHPDBG_UTILS_H
-#include "TSRM.h"
-
/**
* Input scan functions
*/
@@ -53,4 +51,7 @@ void phpdbg_print(int TSRMLS_DC, const char*, ...);
/* {{{ For prompt lines */
#define PROMPT ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64mphpdbg>\033[0m
" : "phpdbg> ") /* }}} */
+/* {{{ For separation */
+#define SEPARATE "------------------------------------------------" /* }}} */
+
#endif /* PHPDBG_UTILS_H */