]> granicus.if.org Git - php/commitdiff
updates for windows
authorkrakjoe <joe.watkins@live.co.uk>
Wed, 13 Nov 2013 21:15:45 +0000 (21:15 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Wed, 13 Nov 2013 21:15:45 +0000 (21:15 +0000)
config.w32
phpdbg_prompt.c
phpdbg_utils.c
phpdbg_utils.h

index 2359283998383d7f1ee84a83ed8fcc50e3de85b0..b3893ccc2da99044506294483f7d571b6bb79c4d 100644 (file)
@@ -1,5 +1,6 @@
 ARG_ENABLE('phpdbg', 'Build phpdbg', 'yes');
 
 if (PHP_PHPDBG == "yes") {
-    SAPI('phpdbg', 'phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c', 'phpdbg.exe');
+    SAPI('phpdbg', 'phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c', 'phpdbg.exe');
 }
+
index c2bedddcec260b5086796a2f6dbbe51b544a1968..fb19bc703e505fc36f35f2dadc4f64897f6d3c74 100644 (file)
 #include "phpdbg_list.h"
 #include "phpdbg_utils.h"
 
-static const phpdbg_command_t phpdbg_prompt_commands[];
+/* {{{ forward declarations */
+static PHPDBG_COMMAND(exec);
+static PHPDBG_COMMAND(compile);
+static PHPDBG_COMMAND(step);
+static PHPDBG_COMMAND(next);
+static PHPDBG_COMMAND(run);
+static PHPDBG_COMMAND(eval);
+static PHPDBG_COMMAND(print);
+static PHPDBG_COMMAND(break);
+static PHPDBG_COMMAND(back);
+static PHPDBG_COMMAND(list);
+static PHPDBG_COMMAND(clean);
+static PHPDBG_COMMAND(clear);
+static PHPDBG_COMMAND(help);
+static PHPDBG_COMMAND(quiet);
+static PHPDBG_COMMAND(aliases);
+static PHPDBG_COMMAND(quit); /* }}} */
+
+/* {{{ command declarations */
+static const phpdbg_command_t phpdbg_prompt_commands[] = {
+       PHPDBG_COMMAND_EX_D(exec,       "set execution context", 'e'),
+       PHPDBG_COMMAND_EX_D(compile,    "attempt to pre-compile execution context", 'c'),
+       PHPDBG_COMMAND_EX_D(step,       "step through execution", 's'),
+       PHPDBG_COMMAND_EX_D(next,       "continue execution", 'n'),
+       PHPDBG_COMMAND_EX_D(run,        "attempt execution", 'r'),
+       PHPDBG_COMMAND_EX_D(eval,       "evaluate some code", 'E'),
+       PHPDBG_COMMAND_EX_D(print,      "print something", 'p'),
+       PHPDBG_COMMAND_EX_D(break,      "set breakpoint", 'b'),
+       PHPDBG_COMMAND_EX_D(back,       "show trace", 't'),
+       PHPDBG_COMMAND_EX_D(list,       "list specified line or function", 'l'),
+       PHPDBG_COMMAND_EX_D(clean,      "clean the execution environment", 'X'),
+       PHPDBG_COMMAND_EX_D(clear,      "clear breakpoints", 'C'),
+       PHPDBG_COMMAND_EX_D(help,       "show help menu", 'h'),
+       PHPDBG_COMMAND_EX_D(quiet,      "silence some output", 'Q'),
+       PHPDBG_COMMAND_EX_D(aliases,    "show alias list", 'a'),
+       PHPDBG_COMMAND_EX_D(quit,       "exit phpdbg", 'q'),
+       {NULL, 0, 0}
+}; /* }}} */
 
 ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
 
@@ -202,14 +239,17 @@ static PHPDBG_COMMAND(eval) /* {{{ */
 
 static PHPDBG_COMMAND(back) /* {{{ */
 {
+    zval zbacktrace;
+       zval **tmp;
+       HashPosition position;
+       int i = 0, limit = 0;
+       
        if (!EG(in_execution)) {
                phpdbg_error("Not executing!");
                return FAILURE;
        }
-       zval zbacktrace;
-       zval **tmp;
-       HashPosition position;
-       int i = 0, limit = (expr != NULL) ? atoi(expr) : 0;
+       
+       limit = (expr != NULL) ? atoi(expr) : 0;
 
        zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit TSRMLS_CC);
 
@@ -545,26 +585,6 @@ static PHPDBG_COMMAND(list) /* {{{ */
        return SUCCESS;
 } /* }}} */
 
-static const phpdbg_command_t phpdbg_prompt_commands[] = {
-       PHPDBG_COMMAND_EX_D(exec,       "set execution context", 'e'),
-       PHPDBG_COMMAND_EX_D(compile,    "attempt to pre-compile execution context", 'c'),
-       PHPDBG_COMMAND_EX_D(step,       "step through execution", 's'),
-       PHPDBG_COMMAND_EX_D(next,       "continue execution", 'n'),
-       PHPDBG_COMMAND_EX_D(run,        "attempt execution", 'r'),
-       PHPDBG_COMMAND_EX_D(eval,       "evaluate some code", 'E'),
-       PHPDBG_COMMAND_EX_D(print,      "print something", 'p'),
-       PHPDBG_COMMAND_EX_D(break,      "set breakpoint", 'b'),
-       PHPDBG_COMMAND_EX_D(back,       "show trace", 't'),
-       PHPDBG_COMMAND_EX_D(list,       "list specified line or function", 'l'),
-       PHPDBG_COMMAND_EX_D(clean,      "clean the execution environment", 'X'),
-       PHPDBG_COMMAND_EX_D(clear,      "clear breakpoints", 'C'),
-       PHPDBG_COMMAND_EX_D(help,       "show help menu", 'h'),
-       PHPDBG_COMMAND_EX_D(quiet,      "silence some output", 'Q'),
-       PHPDBG_COMMAND_EX_D(aliases,    "show alias list", 'a'),
-       PHPDBG_COMMAND_EX_D(quit,       "exit phpdbg", 'q'),
-       {NULL, 0, 0}
-};
-
 int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_len TSRMLS_DC) /* {{{ */
 {
        char *expr = NULL;
index 02fd46af5ff2ceb1bf741274b37b1e1608dadd1e..d506a25eedbf6562d5c1ddfeb2cd8b0d9c56ffd1 100644 (file)
@@ -91,21 +91,21 @@ int phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */
     /* TODO(anyone) colours */
 
        switch (type) {
-               case ERROR:
+               case P_ERROR:
                        rc = printf("%s%s%s\n",
                                    ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;31m[" : "["),
                                    buffer,
                                    ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "]\033[0m" : "]"));
                break;
 
-               case NOTICE:
+               case P_NOTICE:
                        rc = printf("%s%s%s\n",
                                    ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64m[" : "["),
                                    buffer,
                                    ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "]\033[0m" : "]"));
                break;
                
-               case WRITELN: {
+               case P_WRITELN: {
                    if (buffer) {
                            rc = printf("%s%s%s\n",
                                        ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[37m" : ""),
@@ -116,7 +116,7 @@ int phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */
                        }
                } break;
                
-               case WRITE: if (buffer) {
+               case P_WRITE: if (buffer) {
                    rc = printf("%s%s%s",
                            ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[37m" : ""),
                            buffer,
index b45342d0e07b14c455e744d5e0fd98c2c2735e0c..615e33506b368668d73d1eb92d02896673ed11c1 100644 (file)
@@ -32,18 +32,18 @@ int phpdbg_is_class_method(const char*, size_t, char**, char**);
  * Error/notice/formatting helper
  */
 enum {
-       ERROR  = 1,
-       NOTICE,
-       WRITELN,
-       WRITE
+       P_ERROR  = 1,
+       P_NOTICE,
+       P_WRITELN,
+       P_WRITE
 };
 
 int phpdbg_print(int TSRMLS_DC, const char*, ...);
 
-#define phpdbg_error(fmt, ...)  phpdbg_print(ERROR  TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_notice(fmt, ...) phpdbg_print(NOTICE TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_writeln(fmt, ...) phpdbg_print(WRITELN TSRMLS_CC, fmt, ##__VA_ARGS__)
-#define phpdbg_write(fmt, ...) phpdbg_print(WRITE TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_error(fmt, ...)  phpdbg_print(P_ERROR  TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_notice(fmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_writeln(fmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, fmt, ##__VA_ARGS__)
+#define phpdbg_write(fmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, fmt, ##__VA_ARGS__)
 
 /* {{{ For writing blank lines */
 #define EMPTY "" /* }}} */