[xdebug-dev] xdebug xdebug/php_xdebug.h xdebug/xdebug.c xdebug/xdebug_code_coverage.c xdebug/xdebug_handler_dbgp.c xdebug/xdebug_handler_dbgp.h xdebug/xdebug_handler_gdb.c xdebug/xdebug_handler_gdb.h xdebug/xdebug_handlers.h - Fixed bug #439: Xdebug crash in xdebug_header_handler.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Sat, 4 Jul 2009 16:31:44 +0200

Date: Sat Jul 4 16:31:44 CEST 2009
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Fixed bug #439: Xdebug crash in xdebug_header_handler.
#- There were API changes in PHp 5.3 that I missed.
- Fixed random GCC warnings.

Modified files:
           xdebug/php_xdebug.h (version: 1.151)
           xdebug/xdebug.c (version: 1.450)
           xdebug/xdebug_code_coverage.c (version: 1.53)
           xdebug/xdebug_handler_dbgp.c (version: 1.138)
           xdebug/xdebug_handler_dbgp.h (version: 1.23)
           xdebug/xdebug_handler_gdb.c (version: 1.92)
           xdebug/xdebug_handler_gdb.h (version: 1.33)
           xdebug/xdebug_handlers.h (version: 1.38)

[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -r1.150 -r1.151
--- xdebug/php_xdebug.h:1.150 Thu Jun 11 06:10:34 2009 GMT
+++ xdebug/php_xdebug.h Sat Jul 04 12:31:44 2009 GMT
@@ -64,6 +64,14 @@
 # define XG_MEMORY_PEAK_USAGE() AG(allocated_memory_peak)
 #endif
 
+#if PHP_VERSION_ID >= 50300
+# define XG_SAPI_HEADER_OP_DC , sapi_header_op_enum op
+# define XG_SAPI_HEADER_OP_CC , op
+#else
+# define XG_SAPI_HEADER_OP_DC
+# define XG_SAPI_HEADER_OP_CC
+#endif
+
 PHP_MINIT_FUNCTION(xdebug);
 PHP_MSHUTDOWN_FUNCTION(xdebug);
 PHP_RINIT_FUNCTION(xdebug);
@@ -194,7 +202,7 @@
 
         /* headers */
         xdebug_llist *headers;
- int (*orig_header_handler)(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC);
+ int (*orig_header_handler)(sapi_header_struct *h XG_SAPI_HEADER_OP_DC, sapi_headers_struct *s TSRMLS_DC);
 
         /* remote settings */
         zend_bool remote_enable; /* 0 */

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.449
retrieving revision 1.450
diff -u -r1.449 -r1.450
--- xdebug/xdebug.c:1.449 Thu Jun 11 06:10:34 2009 GMT
+++ xdebug/xdebug.c Sat Jul 04 12:31:44 2009 GMT
@@ -83,7 +83,7 @@
 void (*new_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
 void xdebug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
 
-static int xdebug_header_handler(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC);
+static int xdebug_header_handler(sapi_header_struct *h XG_SAPI_HEADER_OP_DC, sapi_headers_struct *s TSRMLS_DC);
 
 void xdebug_throw_exception_hook(zval *exception TSRMLS_DC);
 int xdebug_exit_handler(ZEND_OPCODE_HANDLER_ARGS);
@@ -476,7 +476,7 @@
                 zend_op *cur_opcode; \
                 int lineno; \
                 char *file; \
- int file_len; \
+\
                 zend_op_array *op_array = execute_data->op_array; \
 \
                 cur_opcode = *EG(opline_ptr); \
@@ -495,7 +495,7 @@
         int lineno;
         char *file, *varname, *full_varname;
         int is_var, cv_len;
- zval *val, *dimval, *mainval;
+ zval *val, *dimval;
         zend_op_array *op_array = execute_data->op_array;
 
         cur_opcode = *EG(opline_ptr);
@@ -1175,8 +1175,6 @@
                 }
 
                 if (tmp->function.type == XFUNC_EVAL) {
- int is_var;
-
                         tmp->include_filename = xdebug_sprintf("'%s'", XG(last_eval_statement));
                 } else if (XG(collect_includes)) {
                         tmp->include_filename = xdstrdup(zend_get_executed_filename(TSRMLS_C));
@@ -2085,7 +2083,7 @@
 
 static char* return_trace_assignment(function_stack_entry *i, char *varname, zval *retval, char *op, char *filename, int lineno TSRMLS_DC)
 {
- int j = 0; /* Counter */
+ int j = 0;
         xdebug_str str = {0, 0, NULL};
         char *tmp_value;
 
@@ -2593,11 +2591,11 @@
 }
 /* }}} */
 
-static int xdebug_header_handler(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC)
+static int xdebug_header_handler(sapi_header_struct *h XG_SAPI_HEADER_OP_DC, sapi_headers_struct *s TSRMLS_DC)
 {
         xdebug_llist_insert_next(XG(headers), XDEBUG_LLIST_TAIL(XG(headers)), xdstrdup(h->header));
         if (XG(orig_header_handler)) {
- return XG(orig_header_handler)(h, s TSRMLS_CC);
+ return XG(orig_header_handler)(h XG_SAPI_HEADER_OP_CC, s TSRMLS_CC);
         }
         return SAPI_HEADER_ADD;
 }
@@ -2925,7 +2923,7 @@
                         if (debugzval) {
                                 printf("%s: ", Z_STRVAL_PP(args[i]));
                                 val = xdebug_get_zval_value(debugzval, 1, NULL);
- printf("%s(%d)", val, strlen(val));
+ printf("%s(%zd)", val, strlen(val));
                                 xdfree(val);
                                 printf("\n");
                         }
@@ -3116,7 +3114,7 @@
                         u_time = xdebug_get_utime();
                         fprintf(XG(trace_file), XG(trace_format) == 0 ? "%10.4f " : "\t\t\t%f\t", u_time - XG(start_time));
 #if HAVE_PHP_MEMORY_USAGE
- fprintf(XG(trace_file), XG(trace_format) == 0 ? "%10u" : "%lu", XG_MEMORY_USAGE());
+ fprintf(XG(trace_file), XG(trace_format) == 0 ? "%10zu" : "%lu", XG_MEMORY_USAGE());
 #else
                         fprintf(XG(trace_file), XG(trace_format) == 0 ? "%10u" : "", 0);
 #endif

[FILE: /xdebug/xdebug_code_coverage.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- xdebug/xdebug_code_coverage.c:1.52 Mon May 11 06:34:07 2009 GMT
+++ xdebug/xdebug_code_coverage.c Sat Jul 04 12:31:44 2009 GMT
@@ -227,9 +227,6 @@
 
 static void prefill_from_oparray(char *fn, zend_op_array *opa TSRMLS_DC)
 {
- char cache_key[256];
- int cache_key_len;
- void *dummy;
         unsigned int i;
         xdebug_set *set = NULL;
 

[FILE: /xdebug/xdebug_handler_dbgp.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -r1.137 -r1.138
--- xdebug/xdebug_handler_dbgp.c:1.137 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handler_dbgp.c Sat Jul 04 12:31:44 2009 GMT
@@ -2269,7 +2269,7 @@
 
 char *xdebug_dbgp_get_revision(void)
 {
- return "$Revision: 1.137 $";
+ return "$Revision: 1.138 $";
 }
 
 static int xdebug_dbgp_cmdloop(xdebug_con *context, int bail TSRMLS_DC)
@@ -2543,7 +2543,7 @@
         return 1;
 }
 
-int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, const char *file, long lineno, int type, char *exception, char *message)
+int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *message)
 {
         xdebug_xml_node *response, *error_container;
         TSRMLS_FETCH();

[FILE: /xdebug/xdebug_handler_dbgp.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- xdebug/xdebug_handler_dbgp.h:1.22 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handler_dbgp.h Sat Jul 04 12:31:44 2009 GMT
@@ -91,7 +91,7 @@
 int xdebug_dbgp_init(xdebug_con *context, int mode);
 int xdebug_dbgp_deinit(xdebug_con *context);
 int xdebug_dbgp_error(xdebug_con *context, int type, char *exception_type, char *message, const char *location, const uint line, xdebug_llist *stack);
-int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, const char *file, long lineno, int type, char *exception, char *message);
+int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *message);
 int xdebug_dbgp_register_eval_id(xdebug_con *context, function_stack_entry *fse);
 int xdebug_dbgp_unregister_eval_id(xdebug_con *context, function_stack_entry *fse, int eval_id);
 char *xdebug_dbgp_get_revision(void);

[FILE: /xdebug/xdebug_handler_gdb.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- xdebug/xdebug_handler_gdb.c:1.91 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handler_gdb.c Sat Jul 04 12:31:44 2009 GMT
@@ -1351,7 +1351,7 @@
 
 char *xdebug_gdb_get_revision(void)
 {
- return "$Revision: 1.91 $";
+ return "$Revision: 1.92 $";
 }
 
 int xdebug_gdb_init(xdebug_con *context, int mode)
@@ -1461,7 +1461,7 @@
         return 1;
 }
 
-int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, const char *file, long lineno, int type, char *exception_type, char *message)
+int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception_type, char *message)
 {
         function_stack_entry *i;
         int ret;

[FILE: /xdebug/xdebug_handler_gdb.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- xdebug/xdebug_handler_gdb.h:1.32 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handler_gdb.h Sat Jul 04 12:31:44 2009 GMT
@@ -73,7 +73,7 @@
 int xdebug_gdb_init(xdebug_con *context, int mode);
 int xdebug_gdb_deinit(xdebug_con *context);
 int xdebug_gdb_error(xdebug_con *context, int type, char *exception_type, char *message, const char *file, const uint lineno, xdebug_llist *stack);
-int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, const char *file, long lineno, int type, char *exception_type, char *message);
+int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception_type, char *message);
 char *xdebug_gdb_get_revision(void);
 
 #define xdebug_handler_gdb { \

[FILE: /xdebug/xdebug_handlers.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- xdebug/xdebug_handlers.h:1.37 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handlers.h Sat Jul 04 12:31:44 2009 GMT
@@ -112,7 +112,7 @@
         int (*remote_error)(xdebug_con *h, int type, char *exception_type, char *message, const char *location, const uint line, xdebug_llist *stack);
 
         /* Breakpoints */
- int (*remote_breakpoint)(xdebug_con *h, xdebug_llist *stack, const char *file, long lineno, int type, char *exception, char *message);
+ int (*remote_breakpoint)(xdebug_con *h, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *message);
 
         /* Eval ID registration and removal */
         int (*register_eval_id)(xdebug_con *h, function_stack_entry *fse);
Received on Sat Jul 04 2009 - 16:31:47 BST

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