com php-src: - Moved breakpoint checking to phpdbg_bp.c f ile: phpdbg_bp.c phpdbg_bp.h phpdbg_prompt. c
| From: | Bob Weinand | Date: | Sat, 23 Nov 2013 23:46:24 +0000 |
| Subject: | com php-src: - Moved breakpoint checking to phpdbg_bp.c f ile: phpdbg_bp.c phpdbg_bp.h phpdbg_prompt. c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74668@lists.php.net to get a copy of this message | ||
Commit: 46f5da1dc1c7ede026656b27659d654599984dae
Author: Felipe Pena <felipensp@gmail.com> Sat, 23 Nov 2013 21:46:24 -0200
Parents: 9d9182dfef6e823f20afd98ff3028119120ac9f8
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=46f5da1dc1c7ede026656b27659d654599984dae
Log:
- Moved breakpoint checking to phpdbg_bp.c file
Changed paths:
M phpdbg_bp.c
M phpdbg_bp.h
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_bp.c b/phpdbg_bp.c
index efd73a4..bdd2eef 100644
--- a/phpdbg_bp.c
+++ b/phpdbg_bp.c
@@ -23,6 +23,7 @@
#include "phpdbg.h"
#include "phpdbg_bp.h"
#include "phpdbg_utils.h"
+#include "phpdbg_opcode.h"
#include "zend_globals.h"
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -445,6 +446,36 @@ int phpdbg_find_conditional_breakpoint(TSRMLS_D) /* {{{ */
return breakpoint;
} /* }}} */
+int phpdbg_find_breakpoint(zend_execute_data* execute_data TSRMLS_DC) /* {{{ */
+{
+ if (PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP
+ && phpdbg_find_breakpoint_file(execute_data->op_array TSRMLS_CC) == SUCCESS) {
+ return SUCCESS;
+ }
+
+ if (PHPDBG_G(flags) & (PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_SYM_BP)) {
+ /* check we are at the beginning of the stack */
+ if (execute_data->opline == EG(active_op_array)->opcodes) {
+ if (phpdbg_find_breakpoint_symbol(
+ execute_data->function_state.function TSRMLS_CC) == SUCCESS) {
+ return SUCCESS;
+ }
+ }
+ }
+
+ if (PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP
+ && phpdbg_find_breakpoint_opline(execute_data->opline TSRMLS_CC) == SUCCESS) {
+ return SUCCESS;
+ }
+
+ if (PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP
+ && phpdbg_find_breakpoint_opcode(execute_data->opline->opcode TSRMLS_CC) ==
SUCCESS) {
+ return SUCCESS;
+ }
+
+ return FAILURE;
+} /* }}} */
+
PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D) /* {{{ */
{
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]);
diff --git a/phpdbg_bp.h b/phpdbg_bp.h
index ad57b9c..92d2a63 100644
--- a/phpdbg_bp.h
+++ b/phpdbg_bp.h
@@ -92,6 +92,7 @@ int phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t TSRMLS_DC);
int phpdbg_find_breakpoint_opcode(zend_uchar TSRMLS_DC);
int phpdbg_find_conditional_breakpoint(TSRMLS_D);
int phpdbg_find_catch(zend_uchar TSRMLS_DC);
+int phpdbg_find_breakpoint(zend_execute_data* TSRMLS_DC);
PHPDBG_API void phpdbg_clear_breakpoints(TSRMLS_D);
PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC);
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index 85fb6cf..a065b8f 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -1370,28 +1370,8 @@ zend_vm_enter:
DO_INTERACTIVE();
}
- if ((PHPDBG_G(flags) & PHPDBG_HAS_FILE_BP)
- && phpdbg_find_breakpoint_file(execute_data->op_array TSRMLS_CC) == SUCCESS) {
- DO_INTERACTIVE();
- }
-
- if ((PHPDBG_G(flags) & (PHPDBG_HAS_METHOD_BP|PHPDBG_HAS_SYM_BP))) {
- /* check we are at the beginning of the stack */
- if (execute_data->opline == EG(active_op_array)->opcodes) {
- if (phpdbg_find_breakpoint_symbol(
- execute_data->function_state.function TSRMLS_CC) == SUCCESS) {
- DO_INTERACTIVE();
- }
- }
- }
-
- if (PHPDBG_G(flags) & PHPDBG_HAS_OPLINE_BP
- && phpdbg_find_breakpoint_opline(execute_data->opline TSRMLS_CC) == SUCCESS) {
- DO_INTERACTIVE();
- }
-
- if (PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP
- && phpdbg_find_breakpoint_opcode(execute_data->opline->opcode TSRMLS_CC) ==
SUCCESS) {
+ if (PHPDBG_G(flags) & PHPDBG_BP_MASK
+ && phpdbg_find_breakpoint(execute_data TSRMLS_CC) == SUCCESS) {
DO_INTERACTIVE();
}