]> granicus.if.org Git - php/commitdiff
- Added macro for trailling command
authorFelipe Pena <felipensp@gmail.com>
Sun, 17 Nov 2013 16:10:43 +0000 (14:10 -0200)
committerFelipe Pena <felipensp@gmail.com>
Sun, 17 Nov 2013 16:10:43 +0000 (14:10 -0200)
phpdbg.h
phpdbg_break.h
phpdbg_info.h
phpdbg_list.h
phpdbg_print.h
phpdbg_prompt.c
test.php

index 625d0af0870e3e831f6d456e8820d0cced576668..eb1aed5f432b8226a55d5dc77c76cf5359f8b0e1 100644 (file)
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -139,6 +139,8 @@ struct _phpdbg_command_t {
        const phpdbg_command_t *subs;       /* Sub Commands */
 };
 
+#define PHPDBG_END_COMAND {NULL, 0, NULL, 0, '\0', NULL, NULL}
+
 ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
     HashTable bp[PHPDBG_BREAK_TABLES];  /* break points */
        char *exec;                         /* file to execute */
index 13addb0cdfa79a92576f6b6653380583d2c8d107..c5d5a5a80f85d53a79ae34eb88569844d1dfa255 100644 (file)
@@ -52,7 +52,7 @@ static const phpdbg_command_t phpdbg_break_commands[] = {
        PHPDBG_BREAK_EX_D(on,          "specify breakpoint by expression", 'o'),
        PHPDBG_BREAK_EX_D(lineno,      "specify breakpoint by line of currently executing file", 'l'),
        PHPDBG_BREAK_EX_D(func,        "specify breakpoint by global function name", 'f'),
-       {NULL, 0, 0}
+       PHPDBG_END_COMAND
 };
 
 #endif /* PHPDBG_BREAK_H */
index eb8ebcd086b48e5a423306f8601ec871bf61f163..1e967b07395469f945d594d9d37d00b44a36f1a5 100644 (file)
@@ -40,7 +40,7 @@ PHPDBG_INFO(files);
 
 static const phpdbg_command_t phpdbg_info_commands[] = {
     PHPDBG_INFO_EX_D(files,     "lists included files", 'f'),
-    {NULL, 0, 0}
+    PHPDBG_END_COMAND
 };
 
 #endif /* PHPDBG_INFO_H */
index 7d06d84e5dab3d5b108ea078e32e7f3f3f9c4902..e186bd3d9facc71c4eddf3da96ea1dc326677324 100644 (file)
@@ -46,11 +46,11 @@ void phpdbg_list_function(const zend_function* TSRMLS_DC);
 void phpdbg_list_file(const char*, long, long, int TSRMLS_DC);
 
 static const phpdbg_command_t phpdbg_list_commands[] = {
-    PHPDBG_LIST_EX_D(lines,     "lists the specified lines", 'l'),
-    PHPDBG_LIST_EX_D(class,     "lists the specified class", 'c'),
-    PHPDBG_LIST_EX_D(method,    "lists the specified method", 'm'),
+    PHPDBG_LIST_EX_D(lines,     "lists the specified lines",    'l'),
+    PHPDBG_LIST_EX_D(class,     "lists the specified class",    'c'),
+    PHPDBG_LIST_EX_D(method,    "lists the specified method",   'm'),
     PHPDBG_LIST_EX_D(func,      "lists the specified function", 'f'),
-    {NULL, 0, 0}
+    PHPDBG_END_COMAND
 };
 
 #endif /* PHPDBG_LIST_H */
index dc6a13338cd63261eae1227ce7ddbd7282db0770..40acfe1b6fa572eaef29b09be3a013e7f9b5a31d 100644 (file)
@@ -44,12 +44,12 @@ PHPDBG_PRINT(func);
  * Commands
  */
 static const phpdbg_command_t phpdbg_print_commands[] = {
-       PHPDBG_PRINT_D(exec,       "print execution context instructions", 'e'),
-       PHPDBG_PRINT_D(opline,     "print the current opline information", 'o'),
-       PHPDBG_PRINT_D(class,      "print out the instructions in the specified class", 'c'),
-       PHPDBG_PRINT_D(method,     "print out the instructions in the specified method", 'm'),
+       PHPDBG_PRINT_D(exec,       "print execution context instructions",                 'e'),
+       PHPDBG_PRINT_D(opline,     "print the current opline information",                 'o'),
+       PHPDBG_PRINT_D(class,      "print out the instructions in the specified class",    'c'),
+       PHPDBG_PRINT_D(method,     "print out the instructions in the specified method",   'm'),
        PHPDBG_PRINT_D(func,       "print out the instructions in the specified function", 'f'),
-       {0, 0, 0, 0}
+       PHPDBG_END_COMAND
 };
 
 #endif /* PHPDBG_PRINT_H */
index f4f4a03581ca3536b85fb556e39feb2a55923673..94ea220019ce266fc021ffb64848539a0961b13a 100644 (file)
@@ -77,7 +77,7 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = {
        PHPDBG_COMMAND_EX_D(aliases,    "show alias list",                          'a'),
        PHPDBG_COMMAND_EX_D(oplog,      "sets oplog output",                        'O'),
        PHPDBG_COMMAND_EX_D(quit,       "exit phpdbg",                              'q'),
-       {NULL, 0, 0}
+       PHPDBG_END_COMAND
 }; /* }}} */
 
 ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -845,7 +845,7 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
                                                phpdbg_error("Failed to execute %s!", cmd);
                                        }
                                break;
-       
+
                                case PHPDBG_LEAVE:
                                case PHPDBG_FINISH:
                                case PHPDBG_UNTIL:
@@ -1055,7 +1055,7 @@ zend_vm_enter:
                        /* skip possible breakpoints */
                        goto next;
                }
-               
+
                /* run to next line */
                if (last_step == PHPDBG_UNTIL
                        && last_file == execute_data->op_array->filename
@@ -1063,7 +1063,7 @@ zend_vm_enter:
                        /* skip possible breakpoints */
                        goto next;
                }
-               
+
                /* run to finish */
                if (last_step == PHPDBG_FINISH) {
                        if (execute_data->opline < last_op) {
@@ -1074,7 +1074,7 @@ zend_vm_enter:
                                last_op = NULL;
                        }
                }
-               
+
                /* break for leave */
                if (last_step == PHPDBG_LEAVE) {
                        if (execute_data->opline == last_op) {
@@ -1093,7 +1093,7 @@ zend_vm_enter:
                /* not while in conditionals */
                phpdbg_print_opline(
                        execute_data, 0 TSRMLS_CC);
-               
+
                /* conditions cannot be executed by eval()'d code */
                if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)
                        && (PHPDBG_G(flags) & PHPDBG_HAS_COND_BP)
@@ -1136,17 +1136,17 @@ zend_vm_enter:
 next:
                last_lineno = execute_data->opline->lineno;
                last_file   = execute_data->op_array->filename;
-               
+
                switch (last_step) {
                        case PHPDBG_FINISH:
                                if (!last_op) {
                                        last_op = &execute_data->op_array->opcodes[execute_data->op_array->last-1];
                                }
                        break;
-                       
+
                        case PHPDBG_LEAVE:
                                if (!last_op) {
-                                       last_op = &execute_data->op_array->opcodes[execute_data->op_array->last-2];     
+                                       last_op = &execute_data->op_array->opcodes[execute_data->op_array->last-2];
                                }
                        break;
                }
index 02c58b50da63362e0f286d311a54887b51b9e625..fab577b67e96904d8885aaae3efc0430bdb16032 100644 (file)
--- a/test.php
+++ b/test.php
@@ -1,5 +1,4 @@
 <?php
-include 'web-bootstrap.php'; 
 
 class phpdbg {
     public function isGreat($greeting = null) {