]> granicus.if.org Git - php/commitdiff
housework
authorkrakjoe <joe.watkins@live.co.uk>
Tue, 12 Nov 2013 23:54:41 +0000 (23:54 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Tue, 12 Nov 2013 23:54:41 +0000 (23:54 +0000)
phpdbg.h
phpdbg_bp.c
phpdbg_help.c
phpdbg_prompt.c
phpdbg_utils.h

index 9826c8bb940f8b41eaf7c7f77c0e3ee3b48cec1e..063cce1f9a9cdb3983a9116ca73e3fcf492fed59 100644 (file)
--- 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 */
index 45ecbc5def9bb442b916f14288c66422208d66c5..b4defa1e7088893291efbaf1b20d7b16e5810d0f 100644 (file)
@@ -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;
index b49f45ac1ecd51afa986d2b53c59e0cd5056d487..575061955b60a2317aaca388a5610cb7c27cb6e1 100644 (file)
@@ -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;
 } /* }}} */
index fe1c32608690757347a0d6619e9513a8c0b9a7e2..f221b581eaeb43f8dbf108a83be2669dcaeb1279 100644 (file)
@@ -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
index e51462c7977218688934f783a44f4bf359570c32..7682201493f94bfc1bb6171e9a6fdf2953f70b3a 100644 (file)
@@ -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 */