[xdebug-dev] xdebug xdebug/xdebug.c - Added PHP 5.1 compability for the opcode overrides.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Mon, 1 Nov 2004 13:06:18 +0100

Date: Mon Nov 1 13:06:17 CET 2004
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Added PHP 5.1 compability for the opcode overrides.

Modified files:
           xdebug/xdebug.c (version: 1.248)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.247
retrieving revision 1.248
diff -u -r1.247 -r1.248
--- xdebug/xdebug.c:1.247 Fri Oct 29 08:01:17 2004 GMT
+++ xdebug/xdebug.c Mon Nov 01 11:06:17 2004 GMT
@@ -54,7 +54,7 @@
 #include "zend_extensions.h"
 #ifdef ZEND_ENGINE_2
 # include "zend_exceptions.h"
-# if PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 1
+# if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1
 # include "zend_vm.h"
 # endif
 #endif
@@ -1544,6 +1544,7 @@
 }
 
 /* Needed for code coverage as Zend doesn't always add EXT_STMT when expected */
+#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1
 #define XDEBUG_OPCODE_OVERRIDE(f) static int xdebug_##f##_handler(ZEND_OPCODE_HANDLER_ARGS) \
 { \
         if (XG(do_code_coverage)) { \
@@ -1551,6 +1552,7 @@
                 int lineno; \
                 char *file; \
                 int file_len; \
+ zend_op_array *op_array = execute_data->op_array; \
 \
                 cur_opcode = *EG(opline_ptr); \
                 lineno = cur_opcode->lineno; \
@@ -1562,6 +1564,26 @@
         } \
         return old_##f##_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); \
 }
+#else
+#define xdebug_opcode_override(f) static int xdebug_##f##_handler(zend_opcode_handler_args) \
+{ \
+ if (xg(do_code_coverage)) { \
+ zend_op *cur_opcode; \
+ int lineno; \
+ char *file; \
+ int file_len; \
+\
+ cur_opcode = *eg(opline_ptr); \
+ lineno = cur_opcode->lineno; \
+\
+ file = op_array->filename; \
+ file_len = strlen(file); \
+\
+ xdebug_count_line(file, lineno, 0 tsrmls_cc); \
+ } \
+ return old_##f##_handler(zend_opcode_handler_args_passthru); \
+}
+#endif
 XDEBUG_OPCODE_OVERRIDE(jmp)
 XDEBUG_OPCODE_OVERRIDE(jmpz)
 XDEBUG_OPCODE_OVERRIDE(is_identical)
Received on Mon Nov 01 2004 - 13:06:32 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST