com php-src: - Added macro for trailling command: phpdbg.h phpdbg_break.h phpdbg_info.h phpdbg_list.h ph pdbg_print.h phpdbg_prompt.c test.php
| From: | Bob Weinand | Date: | Sun, 17 Nov 2013 16:10:43 +0000 |
| Subject: | com php-src: - Added macro for trailling command: phpdbg.h phpdbg_break.h phpdbg_info.h phpdbg_list.h ph pdbg_print.h phpdbg_prompt.c test.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74895@lists.php.net to get a copy of this message | ||
Commit: 478446b665acb80411b0c7dee417962e88848842
Author: Felipe Pena <felipensp@gmail.com> Sun, 17 Nov 2013 14:10:43 -0200
Parents: 4ee192ae3d7a4d0b404bb910f7649e77a17abd26
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=478446b665acb80411b0c7dee417962e88848842
Log:
- Added macro for trailling command
Changed paths:
M phpdbg.h
M phpdbg_break.h
M phpdbg_info.h
M phpdbg_list.h
M phpdbg_print.h
M phpdbg_prompt.c
M test.php
Diff:
diff --git a/phpdbg.h b/phpdbg.h
index 625d0af..eb1aed5 100644
--- 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 */
diff --git a/phpdbg_break.h b/phpdbg_break.h
index 13addb0..c5d5a5a 100644
--- a/phpdbg_break.h
+++ b/phpdbg_break.h
@@ -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 */
diff --git a/phpdbg_info.h b/phpdbg_info.h
index eb8ebcd..1e967b0 100644
--- a/phpdbg_info.h
+++ b/phpdbg_info.h
@@ -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 */
diff --git a/phpdbg_list.h b/phpdbg_list.h
index 7d06d84..e186bd3 100644
--- a/phpdbg_list.h
+++ b/phpdbg_list.h
@@ -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 */
diff --git a/phpdbg_print.h b/phpdbg_print.h
index dc6a133..40acfe1 100644
--- a/phpdbg_print.h
+++ b/phpdbg_print.h
@@ -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 */
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index f4f4a03..94ea220 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -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;
}
diff --git a/test.php b/test.php
index 02c58b5..fab577b 100644
--- a/test.php
+++ b/test.php
@@ -1,5 +1,4 @@
<?php
-include 'web-bootstrap.php';
class phpdbg {
public function isGreat($greeting = null) {