[xdebug-dev] xdebug xdebug/Makefile.in xdebug/config.m4 xdebug/config.w32 xdebug/php_xdebug.h xdebug/usefulstuff.c xdebug/usefulstuff.h xdebug/xdebug.c xdebug/xdebug_code_coverage.c xdebug/xdebug_code_coverage.h xdebug/xdebug_com.c xdebug/xdebug_com.h xdebug/xdebug_compat.c xdebug/xdebug_compat.h xdebug/xdebug_handler_dbgp.c xdebug/xdebug_handler_dbgp.h xdebug/xdebug_handler_gdb.c xdebug/xdebug_handler_gdb.h xdebug/xdebug_handler_php3.c xdebug/xdebug_handler_php3.h xdebug/xdebug_handlers.c xdebug/xdebug_handlers.h xdebug/xdebug_hash.c xdebug/xdebug_mm.h xdebug/xdebug_private.c xdebug/xdebug_private.h xdebug/xdebug_profiler.c xdebug/xdebug_profiler.h xdebug/xdebug_set.c xdebug/xdebug_set.h xdebug/xdebug_str.c xdebug/xdebug_str.h xdebug/xdebug_superglobals.c xdebug/xdebug_superglobals.h xdebug/xdebug_var.c xdebug/xdebug_var.h xdebug/xdebug_xml.c xdebug/xdebug_xml.h xdebug/xt.vim First commit to branch - added instruction counting and branch counting.

From: Allister Beharry <allister.beharry[@]gmail.com>
Date: Wed, 15 Jul 2009 13:39:22 +0200

Date: Wed Jul 15 13:39:21 CEST 2009
User: Allister Beharry
Directory: xdebug

Log Message:
First commit to branch - added instruction counting and branch counting.
Modified files:
           xdebug/Makefile.in (version: 1.11.4.1)
           xdebug/config.m4 (version: 1.28.2.1)
           xdebug/config.w32 (version: 1.6.2.1)
           xdebug/php_xdebug.h (version: 1.152.2.1)
           xdebug/usefulstuff.c (version: 1.47.2.1)
           xdebug/usefulstuff.h (version: 1.22.2.1)
           xdebug/xdebug.c (version: 1.454.2.1)
           xdebug/xdebug_code_coverage.c (version: 1.53.2.1)
           xdebug/xdebug_code_coverage.h (version: 1.13.2.1)
           xdebug/xdebug_com.c (version: 1.15.2.1)
           xdebug/xdebug_com.h (version: 1.13.2.1)
           xdebug/xdebug_compat.c (version: 1.13.2.1)
           xdebug/xdebug_compat.h (version: 1.11.2.1)
           xdebug/xdebug_handler_dbgp.c (version: 1.138.2.1)
           xdebug/xdebug_handler_dbgp.h (version: 1.23.2.1)
           xdebug/xdebug_handler_gdb.c (version: 1.92.2.1)
           xdebug/xdebug_handler_gdb.h (version: 1.33.2.1)
           xdebug/xdebug_handler_php3.c (version: 1.23.2.1)
           xdebug/xdebug_handler_php3.h (version: 1.17.2.1)
           xdebug/xdebug_handlers.c (version: 1.19.2.1)
           xdebug/xdebug_handlers.h (version: 1.38.2.1)
           xdebug/xdebug_hash.c (version: 1.6.2.1)
           xdebug/xdebug_mm.h (version: 1.8.2.1)
           xdebug/xdebug_private.c (version: 1.7.2.1)
           xdebug/xdebug_private.h (version: 1.28.2.1)
           xdebug/xdebug_profiler.c (version: 1.53.2.1)
           xdebug/xdebug_profiler.h (version: 1.14.2.1)
           xdebug/xdebug_set.c (version: 1.5.2.1)
           xdebug/xdebug_set.h (version: 1.4.2.1)
           xdebug/xdebug_str.c (version: 1.10.2.1)
           xdebug/xdebug_str.h (version: 1.8.2.1)
           xdebug/xdebug_superglobals.c (version: 1.29.2.1)
           xdebug/xdebug_superglobals.h (version: 1.9.2.1)
           xdebug/xdebug_var.c (version: 1.98.2.1)
           xdebug/xdebug_var.h (version: 1.28.2.1)
           xdebug/xdebug_xml.c (version: 1.14.2.1)
           xdebug/xdebug_xml.h (version: 1.7.2.1)
           xdebug/xt.vim (version: 1.4.2.1)

[FILE: /xdebug/Makefile.in]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.11
retrieving revision 1.11.4.1
diff -u -r1.11 -r1.11.4.1
--- xdebug/Makefile.in:1.11 Sun Oct 12 12:28:58 2003 GMT
+++ xdebug/Makefile.in Wed Jul 15 09:39:20 2009 GMT
@@ -1,7 +1,7 @@
-# $Id: cvstemp,v 1.11 2003/10/12 14:28:58 derick Exp $
+# $Id: cvstemp,v 1.11.4.1 2009/07/15 11:39:20 allisterb Exp $
 
 LTLIBRARY_NAME = libxdebug.la
-LTLIBRARY_SOURCES = xdebug.c xdebug_com.c xdebug_llist.c xdebug_hash.c xdebug_handlers.c xdebug_handler_dbgp.c xdebug_handler_php3.c xdebug_handler_gdb.c usefulstuff.c xdebug_str.c xdebug_var.c xdebug_profiler.c
+LTLIBRARY_SOURCES = xdebug.c srm_oparry.c xdebug_com.c xdebug_llist.c xdebug_hash.c xdebug_handlers.c xdebug_handler_dbgp.c xdebug_handler_php3.c xdebug_handler_gdb.c usefulstuff.c xdebug_str.c xdebug_var.c xdebug_profiler.c
 LTLIBRARY_SHARED_NAME = xdebug.la
 LTLIBRARY_SHARED_LIBADD = $(XDEBUG_SHARED_LIBADD)
 

[FILE: /xdebug/config.m4]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -r1.28 -r1.28.2.1
--- xdebug/config.m4:1.28 Wed Jul 30 22:43:35 2008 GMT
+++ xdebug/config.m4 Wed Jul 15 09:39:20 2009 GMT
@@ -1,4 +1,4 @@
-dnl $Id: cvstemp,v 1.28 2008/07/31 00:43:35 sniper Exp $
+dnl $Id: cvstemp,v 1.28.2.1 2009/07/15 11:39:20 allisterb Exp $
 dnl config.m4 for extension xdebug
 
 PHP_ARG_ENABLE(xdebug, whether to enable eXtended debugging support,
@@ -27,7 +27,7 @@
 
   CPPFLAGS=$old_CPPFLAGS
 
- PHP_NEW_EXTENSION(xdebug, xdebug.c xdebug_code_coverage.c xdebug_com.c xdebug_compat.c xdebug_handler_dbgp.c xdebug_handler_gdb.c xdebug_handler_php3.c xdebug_handlers.c xdebug_llist.c xdebug_hash.c xdebug_private.c xdebug_profiler.c xdebug_set.c xdebug_str.c xdebug_superglobals.c xdebug_var.c xdebug_xml.c usefulstuff.c, $ext_shared,,,,yes)
- PHP_SUBST(XDEBUG_SHARED_LIBADD)
   PHP_ADD_MAKEFILE_FRAGMENT
+ PHP_SUBST(XDEBUG_SHARED_LIBADD)
+ PHP_NEW_EXTENSION(xdebug, xdebug.c xdebug_code_coverage.c srm_oparray.c xdebug_com.c xdebug_compat.c xdebug_handler_dbgp.c xdebug_handler_gdb.c xdebug_handler_php3.c xdebug_handlers.c xdebug_llist.c xdebug_hash.c xdebug_private.c xdebug_profiler.c xdebug_set.c xdebug_str.c xdebug_superglobals.c xdebug_var.c xdebug_xml.c usefulstuff.c, $ext_shared)
 fi

[FILE: /xdebug/config.w32]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- xdebug/config.w32:1.6 Mon Apr 06 18:41:21 2009 GMT
+++ xdebug/config.w32 Wed Jul 15 09:39:20 2009 GMT
@@ -1,10 +1,10 @@
-// $Id: cvstemp,v 1.6 2009/04/06 20:41:21 derick Exp $
+// $Id: cvstemp,v 1.6.2.1 2009/07/15 11:39:20 allisterb Exp $
 // vim:ft=javascript
 
-ARG_WITH("xdebug", "Xdebug support", "no");
+ARG_WITH("xdebug", "Xdebug support", "yes");
 
 if (PHP_XDEBUG == "yes") {
- EXTENSION("xdebug", "xdebug.c xdebug_code_coverage.c xdebug_com.c xdebug_compat.c xdebug_handler_dbgp.c xdebug_handler_gdb.c xdebug_handler_php3.c xdebug_handlers.c xdebug_llist.c xdebug_hash.c xdebug_private.c xdebug_profiler.c xdebug_set.c xdebug_str.c xdebug_superglobals.c xdebug_var.c xdebug_xml.c usefulstuff.c");
+ EXTENSION("xdebug", "xdebug.c xdebug_code_coverage.c srm_oparray.c xdebug_com.c xdebug_compat.c xdebug_handler_dbgp.c xdebug_handler_gdb.c xdebug_handler_php3.c xdebug_handlers.c xdebug_llist.c xdebug_hash.c xdebug_private.c xdebug_profiler.c xdebug_set.c xdebug_str.c xdebug_superglobals.c xdebug_var.c xdebug_xml.c usefulstuff.c");
         AC_DEFINE("HAVE_XDEBUG", 1, "Xdebug support");
         AC_DEFINE("HAVE_EXECUTE_DATA_PTR", 1);
 }

[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.152
retrieving revision 1.152.2.1
diff -u -r1.152 -r1.152.2.1
--- xdebug/php_xdebug.h:1.152 Mon Jul 06 07:05:59 2009 GMT
+++ xdebug/php_xdebug.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -20,10 +20,9 @@
 #define PHP_XDEBUG_H
 
 #define XDEBUG_NAME "Xdebug"
-#define XDEBUG_VERSION "2.1.0-dev"
+#define XDEBUG_VERSION "2.0.5"
 #define XDEBUG_AUTHOR "Derick Rethans"
 #define XDEBUG_COPYRIGHT "Copyright (c) 2002-2009 by Derick Rethans"
-#define XDEBUG_COPYRIGHT_SHORT "Copyright (c) 2002-2009"
 #define XDEBUG_URL "http://xdebug.org"
 
 #include "php.h"
@@ -47,8 +46,6 @@
 #include "TSRM.h"
 #endif
 
-#include "main/SAPI.h"
-
 #if MEMORY_LIMIT
 # define HAVE_PHP_MEMORY_USAGE 1
 #elif PHP_VERSION_ID >= 50201
@@ -65,25 +62,18 @@
 # 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);
 PHP_RSHUTDOWN_FUNCTION(xdebug);
 PHP_MINFO_FUNCTION(xdebug);
+#ifdef ZEND_ENGINE_2
 ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xdebug);
+#endif
 
 /* call stack functions */
 PHP_FUNCTION(xdebug_get_stack_depth);
 PHP_FUNCTION(xdebug_get_function_stack);
-PHP_FUNCTION(xdebug_get_formatted_function_stack);
 PHP_FUNCTION(xdebug_print_function_stack);
 PHP_FUNCTION(xdebug_get_declared_vars);
 PHP_FUNCTION(xdebug_call_class);
@@ -110,11 +100,6 @@
 PHP_FUNCTION(xdebug_stop_trace);
 PHP_FUNCTION(xdebug_get_tracefile_name);
 
-/* error collecting functions */
-PHP_FUNCTION(xdebug_start_error_collection);
-PHP_FUNCTION(xdebug_stop_error_collection);
-PHP_FUNCTION(xdebug_get_collected_errors);
-
 /* profiling functions */
 PHP_FUNCTION(xdebug_get_profiler_filename);
 PHP_FUNCTION(xdebug_dump_aggr_profiling_data);
@@ -122,7 +107,6 @@
 
 /* misc functions */
 PHP_FUNCTION(xdebug_dump_superglobals);
-PHP_FUNCTION(xdebug_get_headers);
 #if HAVE_PHP_MEMORY_USAGE
 PHP_FUNCTION(xdebug_memory_usage);
 PHP_FUNCTION(xdebug_peak_memory_usage);
@@ -141,7 +125,6 @@
         long collect_params;
         zend_bool collect_return;
         zend_bool collect_vars;
- zend_bool collect_assignments;
         zend_bool extended_info;
         zend_bool show_ex_trace;
         zend_bool show_local_vars;
@@ -150,12 +133,8 @@
         double start_time;
         HashTable *active_symbol_table;
         zend_execute_data *active_execute_data;
- zend_op_array *active_op_array;
         unsigned int prev_memory;
- char *file_link_format;
 
- zend_bool overload_var_dump;
- zend_bool var_dump_overloaded;
         void (*orig_var_dump_func)(INTERNAL_FUNCTION_PARAMETERS);
         void (*orig_set_time_limit_func)(INTERNAL_FUNCTION_PARAMETERS);
 
@@ -168,7 +147,6 @@
         long trace_format;
         char *tracefile_name;
         char *last_exception_trace;
- char *last_eval_statement;
 
         /* variable dumping limitation settings */
         long display_max_children;
@@ -183,10 +161,6 @@
         unsigned int function_count;
         int reserved_offset;
 
- /* used for collection errors */
- zend_bool do_collect_errors;
- xdebug_llist *collected_errors;
-
         /* superglobals */
         zend_bool dump_globals;
         zend_bool dump_once;
@@ -201,10 +175,6 @@
         xdebug_llist request;
         xdebug_llist session;
 
- /* headers */
- xdebug_llist *headers;
- 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 */
         long remote_port; /* 9000 */
@@ -212,10 +182,8 @@
         long remote_mode; /* XDEBUG_NONE, XDEBUG_JIT, XDEBUG_REQ */
         char *remote_handler; /* php3, gdb, dbgp */
         zend_bool remote_autostart; /* Disables the requirement for XDEBUG_SESSION_START */
- zend_bool remote_connect_back; /* connect back to the HTTP requestor */
         char *remote_log; /* Filename to log protocol communication to */
         FILE *remote_log_file; /* File handler for protocol log */
- long remote_cookie_expire_time; /* Expire time for the remote-session cookie */
 
         char *ide_key; /* from environment, USER, USERNAME or empty */
 
@@ -252,8 +220,6 @@
         HashTable aggr_calls;
         zend_bool profiler_aggregate;
 
- /* scream */
- zend_bool do_scream;
 ZEND_END_MODULE_GLOBALS(xdebug)
 
 #ifdef ZTS

[FILE: /xdebug/usefulstuff.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.47
retrieving revision 1.47.2.1
diff -u -r1.47 -r1.47.2.1
--- xdebug/usefulstuff.c:1.47 Thu May 07 18:39:13 2009 GMT
+++ xdebug/usefulstuff.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/usefulstuff.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -u -r1.22 -r1.22.2.1
--- xdebug/usefulstuff.h:1.22 Thu May 07 18:39:13 2009 GMT
+++ xdebug/usefulstuff.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.454
retrieving revision 1.454.2.1
diff -u -r1.454 -r1.454.2.1
--- xdebug/xdebug.c:1.454 Thu Jul 09 14:51:44 2009 GMT
+++ xdebug/xdebug.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -54,8 +54,12 @@
 #include "zend_compile.h"
 #include "zend_constants.h"
 #include "zend_extensions.h"
-#include "zend_exceptions.h"
-#include "zend_vm.h"
+#ifdef ZEND_ENGINE_2
+# include "zend_exceptions.h"
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
+# include "zend_vm.h"
+# endif
+#endif
 
 #include "php_xdebug.h"
 #include "xdebug_private.h"
@@ -83,23 +87,28 @@
 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 XG_SAPI_HEADER_OP_DC, sapi_headers_struct *s TSRMLS_DC);
-
+#ifdef ZEND_ENGINE_2
 void xdebug_throw_exception_hook(zval *exception TSRMLS_DC);
+#endif
+
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 0)
+int (*old_exit_handler)(ZEND_OPCODE_HANDLER_ARGS);
+#endif
+
+#ifdef ZEND_ENGINE_2
 int xdebug_exit_handler(ZEND_OPCODE_HANDLER_ARGS);
+#endif
 
 static zval *get_zval(zend_execute_data *zdata, znode *node, temp_variable *Ts, int *is_var);
 static char* return_trace_stack_frame_begin(function_stack_entry* i, int fnr TSRMLS_DC);
 static char* return_trace_stack_frame_end(function_stack_entry* i, int fnr TSRMLS_DC);
 static char* return_trace_stack_retval(function_stack_entry* i, zval* retval TSRMLS_DC);
-static char* return_trace_assignment(function_stack_entry *i, char *varname, zval *retval, char *op, char *file, int fileno TSRMLS_DC);
 
 int zend_xdebug_initialised = 0;
 
 function_entry xdebug_functions[] = {
         PHP_FE(xdebug_get_stack_depth, NULL)
         PHP_FE(xdebug_get_function_stack, NULL)
- PHP_FE(xdebug_get_formatted_function_stack, NULL)
         PHP_FE(xdebug_print_function_stack, NULL)
         PHP_FE(xdebug_get_declared_vars, NULL)
         PHP_FE(xdebug_call_class, NULL)
@@ -130,17 +139,12 @@
 #endif
         PHP_FE(xdebug_time_index, NULL)
 
- PHP_FE(xdebug_start_error_collection, NULL)
- PHP_FE(xdebug_stop_error_collection, NULL)
- PHP_FE(xdebug_get_collected_errors, NULL)
-
         PHP_FE(xdebug_start_code_coverage, NULL)
         PHP_FE(xdebug_stop_code_coverage, NULL)
         PHP_FE(xdebug_get_code_coverage, NULL)
         PHP_FE(xdebug_get_function_count, NULL)
 
         PHP_FE(xdebug_dump_superglobals, NULL)
- PHP_FE(xdebug_get_headers, NULL)
         {NULL, NULL, NULL}
 };
 
@@ -151,13 +155,21 @@
         PHP_MINIT(xdebug),
         PHP_MSHUTDOWN(xdebug),
         PHP_RINIT(xdebug),
+#ifndef ZEND_ENGINE_2
+ PHP_RSHUTDOWN(xdebug),
+#else
         NULL,
+#endif
         PHP_MINFO(xdebug),
         XDEBUG_VERSION,
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6
         NO_MODULE_GLOBALS,
 #endif
+#ifdef ZEND_ENGINE_2
         ZEND_MODULE_POST_ZEND_DEACTIVATE_N(xdebug),
+#else
+ NULL,
+#endif
         STANDARD_MODULE_PROPERTIES_EX
 };
 
@@ -243,19 +255,29 @@
         STD_PHP_INI_BOOLEAN("xdebug.auto_trace", "0", PHP_INI_ALL, OnUpdateBool, auto_trace, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.trace_output_dir", "/tmp", PHP_INI_ALL, OnUpdateString, trace_output_dir, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.trace_output_name", "trace.%c", PHP_INI_ALL, OnUpdateString, trace_output_name, zend_xdebug_globals, xdebug_globals)
+#if ZEND_EXTENSION_API_NO < 90000000
+ STD_PHP_INI_ENTRY("xdebug.trace_format", "0", PHP_INI_ALL, OnUpdateInt, trace_format, zend_xdebug_globals, xdebug_globals)
+ STD_PHP_INI_ENTRY("xdebug.trace_options", "0", PHP_INI_ALL, OnUpdateInt, trace_options, zend_xdebug_globals, xdebug_globals)
+#else
         STD_PHP_INI_ENTRY("xdebug.trace_format", "0", PHP_INI_ALL, OnUpdateLong, trace_format, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.trace_options", "0", PHP_INI_ALL, OnUpdateLong, trace_options, zend_xdebug_globals, xdebug_globals)
+#endif
         STD_PHP_INI_BOOLEAN("xdebug.collect_includes","1", PHP_INI_ALL, OnUpdateBool, collect_includes, zend_xdebug_globals, xdebug_globals)
+#if ZEND_EXTENSION_API_NO < 90000000
+ STD_PHP_INI_ENTRY("xdebug.collect_params", "0", PHP_INI_ALL, OnUpdateInt, collect_params, zend_xdebug_globals, xdebug_globals)
+#else
         STD_PHP_INI_ENTRY("xdebug.collect_params", "0", PHP_INI_ALL, OnUpdateLong, collect_params, zend_xdebug_globals, xdebug_globals)
+#endif
         STD_PHP_INI_BOOLEAN("xdebug.collect_return", "0", PHP_INI_ALL, OnUpdateBool, collect_return, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.collect_vars", "0", PHP_INI_ALL, OnUpdateBool, collect_vars, zend_xdebug_globals, xdebug_globals)
- STD_PHP_INI_BOOLEAN("xdebug.collect_assignments", "0", PHP_INI_ALL, OnUpdateBool, collect_assignments, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.default_enable", "1", PHP_INI_ALL, OnUpdateBool, default_enable, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.extended_info", "1", PHP_INI_SYSTEM, OnUpdateBool, extended_info, zend_xdebug_globals, xdebug_globals)
- STD_PHP_INI_ENTRY("xdebug.file_link_format", "", PHP_INI_ALL, OnUpdateString, file_link_format, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.manual_url", "http://www.php.net", PHP_INI_ALL, OnUpdateString, manual_url, zend_xdebug_globals, xdebug_globals)
+#if ZEND_EXTENSION_API_NO < 90000000
+ STD_PHP_INI_ENTRY("xdebug.max_nesting_level", "100", PHP_INI_ALL, OnUpdateInt, max_nesting_level, zend_xdebug_globals, xdebug_globals)
+#else
         STD_PHP_INI_ENTRY("xdebug.max_nesting_level", "100", PHP_INI_ALL, OnUpdateLong, max_nesting_level, zend_xdebug_globals, xdebug_globals)
- STD_PHP_INI_BOOLEAN("xdebug.overload_var_dump", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, overload_var_dump, zend_xdebug_globals, xdebug_globals)
+#endif
         STD_PHP_INI_BOOLEAN("xdebug.show_exception_trace", "0", PHP_INI_ALL, OnUpdateBool, show_ex_trace, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.show_local_vars", "0", PHP_INI_ALL, OnUpdateBool, show_local_vars, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_BOOLEAN("xdebug.show_mem_delta", "0", PHP_INI_ALL, OnUpdateBool, show_mem_delta, zend_xdebug_globals, xdebug_globals)
@@ -286,20 +308,25 @@
         STD_PHP_INI_ENTRY("xdebug.remote_handler", "dbgp", PHP_INI_ALL, OnUpdateString, remote_handler, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.remote_host", "localhost", PHP_INI_ALL, OnUpdateString, remote_host, zend_xdebug_globals, xdebug_globals)
         PHP_INI_ENTRY("xdebug.remote_mode", "req", PHP_INI_ALL, OnUpdateDebugMode)
+#if ZEND_EXTENSION_API_NO < 90000000
+ STD_PHP_INI_ENTRY("xdebug.remote_port", "9000", PHP_INI_ALL, OnUpdateInt, remote_port, zend_xdebug_globals, xdebug_globals)
+#else
         STD_PHP_INI_ENTRY("xdebug.remote_port", "9000", PHP_INI_ALL, OnUpdateLong, remote_port, zend_xdebug_globals, xdebug_globals)
+#endif
         STD_PHP_INI_BOOLEAN("xdebug.remote_autostart","0", PHP_INI_ALL, OnUpdateBool, remote_autostart, zend_xdebug_globals, xdebug_globals)
- STD_PHP_INI_BOOLEAN("xdebug.remote_connect_back","0", PHP_INI_SYSTEM, OnUpdateBool, remote_connect_back, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.remote_log", "", PHP_INI_ALL, OnUpdateString, remote_log, zend_xdebug_globals, xdebug_globals)
         PHP_INI_ENTRY("xdebug.idekey", "", PHP_INI_ALL, OnUpdateIDEKey)
- STD_PHP_INI_ENTRY("xdebug.remote_cookie_expire_time", "3600", PHP_INI_ALL, OnUpdateLong, remote_cookie_expire_time, zend_xdebug_globals, xdebug_globals)
 
         /* Variable display settings */
+#if ZEND_EXTENSION_API_NO < 90000000
+ STD_PHP_INI_ENTRY("xdebug.var_display_max_children", "128", PHP_INI_ALL, OnUpdateInt, display_max_children, zend_xdebug_globals, xdebug_globals)
+ STD_PHP_INI_ENTRY("xdebug.var_display_max_data", "512", PHP_INI_ALL, OnUpdateInt, display_max_data, zend_xdebug_globals, xdebug_globals)
+ STD_PHP_INI_ENTRY("xdebug.var_display_max_depth", "3", PHP_INI_ALL, OnUpdateInt, display_max_depth, zend_xdebug_globals, xdebug_globals)
+#else
         STD_PHP_INI_ENTRY("xdebug.var_display_max_children", "128", PHP_INI_ALL, OnUpdateLong, display_max_children, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.var_display_max_data", "512", PHP_INI_ALL, OnUpdateLong, display_max_data, zend_xdebug_globals, xdebug_globals)
         STD_PHP_INI_ENTRY("xdebug.var_display_max_depth", "3", PHP_INI_ALL, OnUpdateLong, display_max_depth, zend_xdebug_globals, xdebug_globals)
-
- /* Scream support */
- STD_PHP_INI_BOOLEAN("xdebug.scream", "0", PHP_INI_ALL, OnUpdateBool, do_scream, zend_xdebug_globals, xdebug_globals)
+#endif
 PHP_INI_END()
 
 static void php_xdebug_init_globals (zend_xdebug_globals *xg TSRMLS_DC)
@@ -412,9 +439,6 @@
                 } else
                 if (strcasecmp(envvar, "remote_log") == 0) {
                         name = "xdebug.remote_log";
- } else
- if (strcasecmp(envvar, "remote_cookie_expire_time") == 0) {
- name = "xdebug.remote_cookie_expire_time";
                 }
 
                 if (name) {
@@ -425,188 +449,171 @@
         xdebug_arg_dtor(parts);
 }
 
-static int xdebug_silence_handler(ZEND_OPCODE_HANDLER_ARGS)
-{
- if (XG(do_scream)) {
- execute_data->opline++;
- return ZEND_USER_OPCODE_CONTINUE;
- }
- return ZEND_USER_OPCODE_DISPATCH;
-}
-
-static int xdebug_include_or_eval_handler(ZEND_OPCODE_HANDLER_ARGS)
-{
- zend_op *opline = execute_data->opline;
-
- if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
- zval *inc_filename;
- zval tmp_inc_filename;
- int is_var;
- int tmp_len;
-
- inc_filename = get_zval(execute_data, &opline->op1, execute_data->Ts, &is_var);
-
- if (inc_filename->type != IS_STRING) {
- tmp_inc_filename = *inc_filename;
- zval_copy_ctor(&tmp_inc_filename);
- convert_to_string(&tmp_inc_filename);
- inc_filename = &tmp_inc_filename;
- }
-
- /* Now let's store this info */
- if (XG(last_eval_statement)) {
- efree(XG(last_eval_statement));
- }
- XG(last_eval_statement) = php_addcslashes(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename), &tmp_len, 0, "'\\\0..\37", 6 TSRMLS_CC);
-
- if (inc_filename == &tmp_inc_filename) {
- zval_dtor(&tmp_inc_filename);
- }
- }
- return ZEND_USER_OPCODE_DISPATCH;
-}
-
+#ifdef ZEND_ENGINE_2
 /* Needed for code coverage as Zend doesn't always add EXT_STMT when expected */
-#define XDEBUG_SET_OPCODE_OVERRIDE(f,oc) \
- zend_set_user_opcode_handler(oc, xdebug_##f##_handler);
-
-#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; \
-\
- zend_op_array *op_array = execute_data->op_array; \
-\
- cur_opcode = *EG(opline_ptr); \
- lineno = cur_opcode->lineno; \
-\
- file = op_array->filename; \
-\
- xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC); \
- } \
- return ZEND_USER_OPCODE_DISPATCH; \
-}
-
-static int xdebug_common_assign_dim_handler(char *op, int do_cc, ZEND_OPCODE_HANDLER_ARGS)
-{
- zend_op *cur_opcode, *next_opcode, *prev_opcode = NULL;
- int lineno;
- char *file, *varname, *full_varname;
- int is_var, cv_len;
- zval *val, *dimval;
- zend_op_array *op_array = execute_data->op_array;
-
- cur_opcode = *EG(opline_ptr);
- next_opcode = cur_opcode + 1;
- prev_opcode = cur_opcode - 1;
- lineno = cur_opcode->lineno;
-
- file = op_array->filename;
-
- if (do_cc && XG(do_code_coverage)) {
- xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC);
- }
- if (XG(do_trace) && XG(trace_file) && XG(collect_assignments)) {
- char* t;
- xdebug_llist_element *le;
- function_stack_entry *fse;
-
- le = XDEBUG_LLIST_TAIL(XG(stack));
- fse = XDEBUG_LLIST_VALP(le);
-
- if (cur_opcode->op1.op_type == IS_VAR &&
- (next_opcode->op1.op_type == IS_VAR || cur_opcode->op2.op_type == IS_VAR) &&
- prev_opcode->opcode == ZEND_FETCH_RW &&
- prev_opcode->op1.op_type == IS_CONST &&
- prev_opcode->op1.u.constant.type == IS_STRING
- ) {
- varname = prev_opcode->op1.u.constant.value.str.val;
- } else if (cur_opcode->op1.op_type == IS_UNUSED) {
- varname = "this";
- } else if (cur_opcode->op1.op_type == IS_CV) {
- varname = zend_get_compiled_variable_name(op_array, cur_opcode->op1.u.var, &cv_len);
- }
- if (next_opcode->opcode == ZEND_OP_DATA) {
- dimval = get_zval(execute_data, &cur_opcode->op2, execute_data->Ts, &is_var);
- if (next_opcode->op2.op_type != IS_UNUSED || cur_opcode->op1.op_type == IS_UNUSED) {
- full_varname = xdebug_sprintf("%s->%s", varname, Z_STRVAL_P(dimval));
- } else {
- full_varname = xdebug_sprintf("%s['%s']", varname, Z_STRVAL_P(dimval));
- }
- val = get_zval(execute_data, &next_opcode->op1, execute_data->Ts, &is_var);
- } else {
- full_varname = xdstrdup(varname);
- val = get_zval(execute_data, &cur_opcode->op2, execute_data->Ts, &is_var);
- }
-
- t = return_trace_assignment(fse, full_varname, val, op, file, lineno TSRMLS_CC);
- xdfree(full_varname);
- fprintf(XG(trace_file), "%s", t);
- fflush(XG(trace_file));
- xdfree(t);
- }
- return ZEND_USER_OPCODE_DISPATCH;
-}
-
-#define XDEBUG_OPCODE_OVERRIDE_ASSIGN(f,o,cc) \
- static int xdebug_##f##_handler(ZEND_OPCODE_HANDLER_ARGS) \
- { \
- return xdebug_common_assign_dim_handler((o), (cc), ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); \
- }
-
-
-XDEBUG_OPCODE_OVERRIDE(jmp)
-XDEBUG_OPCODE_OVERRIDE(jmpz)
-XDEBUG_OPCODE_OVERRIDE(jmpnz)
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
+ #define XDEBUG_SET_OPCODE_OVERRIDE(f,oc) \
+ zend_set_user_opcode_handler(oc, xdebug_##f##_handler);
+ #define XDEBUG_OPCODE_OVERRIDE(f) static int xdebug_##f##_handler(ZEND_OPCODE_HANDLER_ARGS) \
+ { \
+ if (XG(do_code_coverage)) { \
+ \
+ zend_op *cur_opcode = *EG(opline_ptr);; \
+ /*
+ zend_op_array *op_array = execute_data->op_array;
+ char *file = op_array->filename; \
+ int file_len = strlen(file); \
+ */ \
+ xdebug_count_instruction(cur_opcode, execute_data TSRMLS_CC); \
+ } \
+ return ZEND_USER_OPCODE_DISPATCH; \
+ }
+#else
+ #define XDEBUG_SET_OPCODE_OVERRIDE(f,oc) \
+ old_##f##_handler = zend_opcode_handlers[oc]; \
+ zend_opcode_handlers[oc] = xdebug_##f##_handler; \
+ \
+ #define XDEBUG_OPCODE_OVERRIDE(f)\
+ static int (*old_##f##_handler)(ZEND_OPCODE_HANDLER_ARGS); \
+ static int xdebug_##f##_handler(ZEND_OPCODE_HANDLER_ARGS) \
+ { \
+ if (XG(do_code_coverage)) { \
+ zend_op *cur_opcode = *EG(opline_ptr);; \
+ /*
+ zend_op_array *op_array = execute_data->op_array;
+ char *file = op_array->filename; \
+ int file_len = strlen(file); \
+ */ xdebug_count_instruction(cur_opcode, execute_data TSRMLS_CC); \
+ } \
+ return old_##f##_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); \
+ }
+#endif
+XDEBUG_OPCODE_OVERRIDE(nop)
+XDEBUG_OPCODE_OVERRIDE(add)
+XDEBUG_OPCODE_OVERRIDE(sub)
+XDEBUG_OPCODE_OVERRIDE(mul)
+XDEBUG_OPCODE_OVERRIDE(div)
+XDEBUG_OPCODE_OVERRIDE(mod)
+XDEBUG_OPCODE_OVERRIDE(sl)
+XDEBUG_OPCODE_OVERRIDE(sr)
+XDEBUG_OPCODE_OVERRIDE(concat)
+XDEBUG_OPCODE_OVERRIDE(bw_or)
+XDEBUG_OPCODE_OVERRIDE(bw_and)
+XDEBUG_OPCODE_OVERRIDE(bw_xor)
+XDEBUG_OPCODE_OVERRIDE(bw_not)
+XDEBUG_OPCODE_OVERRIDE(bool_not)
+XDEBUG_OPCODE_OVERRIDE(bool_xor)
 XDEBUG_OPCODE_OVERRIDE(is_identical)
 XDEBUG_OPCODE_OVERRIDE(is_not_identical)
 XDEBUG_OPCODE_OVERRIDE(is_equal)
 XDEBUG_OPCODE_OVERRIDE(is_not_equal)
 XDEBUG_OPCODE_OVERRIDE(is_smaller)
 XDEBUG_OPCODE_OVERRIDE(is_smaller_or_equal)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign,"=",1)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_add,"+=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_sub,"-=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_mul,"*=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_div,"/=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_mod,"%=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_sl,"<<=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_sr,">>=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_concat,".=",1)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_bw_or,"|=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_bw_and,"&=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_bw_xor,"^=",0)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_dim,"=",1)
-XDEBUG_OPCODE_OVERRIDE_ASSIGN(assign_obj,"=",1)
-XDEBUG_OPCODE_OVERRIDE(add_array_element)
+XDEBUG_OPCODE_OVERRIDE(cast)
+XDEBUG_OPCODE_OVERRIDE(qm_assign)
+XDEBUG_OPCODE_OVERRIDE(assign_add)
+XDEBUG_OPCODE_OVERRIDE(assign_sub)
+XDEBUG_OPCODE_OVERRIDE(assign_mul)
+XDEBUG_OPCODE_OVERRIDE(assign_div)
+XDEBUG_OPCODE_OVERRIDE(assign_mod)
+XDEBUG_OPCODE_OVERRIDE(assign_sl)
+XDEBUG_OPCODE_OVERRIDE(assign_sr)
+XDEBUG_OPCODE_OVERRIDE(assign_concat)
+XDEBUG_OPCODE_OVERRIDE(assign_bw_or)
+XDEBUG_OPCODE_OVERRIDE(assign_bw_and)
+XDEBUG_OPCODE_OVERRIDE(assign_bw_xor)
+XDEBUG_OPCODE_OVERRIDE(pre_inc)
+XDEBUG_OPCODE_OVERRIDE(pre_dec)
+XDEBUG_OPCODE_OVERRIDE(post_inc)
+XDEBUG_OPCODE_OVERRIDE(post_dec)
+XDEBUG_OPCODE_OVERRIDE(assign)
+XDEBUG_OPCODE_OVERRIDE(assign_ref)
+XDEBUG_OPCODE_OVERRIDE(echo)
+XDEBUG_OPCODE_OVERRIDE(print)
+XDEBUG_OPCODE_OVERRIDE(jmp)
+XDEBUG_OPCODE_OVERRIDE(jmpz)
+XDEBUG_OPCODE_OVERRIDE(jmpnz)
+XDEBUG_OPCODE_OVERRIDE(jmpz_ex)
+XDEBUG_OPCODE_OVERRIDE(jmpnz_ex)
+XDEBUG_OPCODE_OVERRIDE(case)
+XDEBUG_OPCODE_OVERRIDE(switch_free)
+XDEBUG_OPCODE_OVERRIDE(bool)
+XDEBUG_OPCODE_OVERRIDE(init_string)
+XDEBUG_OPCODE_OVERRIDE(add_char)
+XDEBUG_OPCODE_OVERRIDE(add_string)
+XDEBUG_OPCODE_OVERRIDE(add_var)
+XDEBUG_OPCODE_OVERRIDE(begin_silence)
+XDEBUG_OPCODE_OVERRIDE(end_silence)
+XDEBUG_OPCODE_OVERRIDE(init_fcall_by_name)
+XDEBUG_OPCODE_OVERRIDE(do_fcall)
+XDEBUG_OPCODE_OVERRIDE(do_fcall_by_name)
 XDEBUG_OPCODE_OVERRIDE(return)
-XDEBUG_OPCODE_OVERRIDE(ext_stmt)
-XDEBUG_OPCODE_OVERRIDE(raise_abstract_error)
-XDEBUG_OPCODE_OVERRIDE(send_var)
-XDEBUG_OPCODE_OVERRIDE(send_var_no_ref)
+XDEBUG_OPCODE_OVERRIDE(recv)
+XDEBUG_OPCODE_OVERRIDE(recv_init)
 XDEBUG_OPCODE_OVERRIDE(send_val)
+XDEBUG_OPCODE_OVERRIDE(send_var)
+XDEBUG_OPCODE_OVERRIDE(send_re)
 XDEBUG_OPCODE_OVERRIDE(new)
-XDEBUG_OPCODE_OVERRIDE(ext_fcall_begin)
-XDEBUG_OPCODE_OVERRIDE(catch)
-XDEBUG_OPCODE_OVERRIDE(bool)
-XDEBUG_OPCODE_OVERRIDE(add_string)
+XDEBUG_OPCODE_OVERRIDE(free)
 XDEBUG_OPCODE_OVERRIDE(init_array)
-XDEBUG_OPCODE_OVERRIDE(fetch_dim_r)
-XDEBUG_OPCODE_OVERRIDE(fetch_obj_r)
+XDEBUG_OPCODE_OVERRIDE(add_array_element)
+XDEBUG_OPCODE_OVERRIDE(include_or_eval)
+XDEBUG_OPCODE_OVERRIDE(unset_var)
+XDEBUG_OPCODE_OVERRIDE(unset_dim)
+XDEBUG_OPCODE_OVERRIDE(unset_obj)
+XDEBUG_OPCODE_OVERRIDE(fe_reset)
+XDEBUG_OPCODE_OVERRIDE(fe_fetch)
+XDEBUG_OPCODE_OVERRIDE(fetch_r)
+XDEBUG_OPCODE_OVERRIDE(dim_r)
+XDEBUG_OPCODE_OVERRIDE(obj_r)
+XDEBUG_OPCODE_OVERRIDE(fetch_w)
+XDEBUG_OPCODE_OVERRIDE(fetch_dim_w)
 XDEBUG_OPCODE_OVERRIDE(fetch_obj_w)
-XDEBUG_OPCODE_OVERRIDE(fetch_obj_func_arg)
+XDEBUG_OPCODE_OVERRIDE(fetch_rw)
+XDEBUG_OPCODE_OVERRIDE(fetch_dim_rw)
+XDEBUG_OPCODE_OVERRIDE(fetch_obj_rw)
+XDEBUG_OPCODE_OVERRIDE(fetch_is)
+XDEBUG_OPCODE_OVERRIDE(fetch_dim_is)
+XDEBUG_OPCODE_OVERRIDE(fetch_obj_is)
+XDEBUG_OPCODE_OVERRIDE(fetch_func_arg)
 XDEBUG_OPCODE_OVERRIDE(fetch_dim_func_arg)
+XDEBUG_OPCODE_OVERRIDE(fetch_obj_func_arg)
+XDEBUG_OPCODE_OVERRIDE(fetch_unset)
 XDEBUG_OPCODE_OVERRIDE(fetch_dim_unset)
 XDEBUG_OPCODE_OVERRIDE(fetch_obj_unset)
-XDEBUG_OPCODE_OVERRIDE(fetch_class)
+XDEBUG_OPCODE_OVERRIDE(fetch_dim_tmp_var)
 XDEBUG_OPCODE_OVERRIDE(fetch_constant)
-XDEBUG_OPCODE_OVERRIDE(concat)
+XDEBUG_OPCODE_OVERRIDE(ext_stmt)
+XDEBUG_OPCODE_OVERRIDE(ext_call_begin)
+XDEBUG_OPCODE_OVERRIDE(ext_call_end)
+XDEBUG_OPCODE_OVERRIDE(ext_nop)
+XDEBUG_OPCODE_OVERRIDE(ticks)
+XDEBUG_OPCODE_OVERRIDE(send_var_no_ref)
+XDEBUG_OPCODE_OVERRIDE(catch)
+XDEBUG_OPCODE_OVERRIDE(throw)
+XDEBUG_OPCODE_OVERRIDE(fetch_class)
+XDEBUG_OPCODE_OVERRIDE(clone)
+XDEBUG_OPCODE_OVERRIDE(init_method_call)
+XDEBUG_OPCODE_OVERRIDE(init_static_method_call)
+XDEBUG_OPCODE_OVERRIDE(isset_isempty_var)
 XDEBUG_OPCODE_OVERRIDE(isset_isempty_dim_obj)
 XDEBUG_OPCODE_OVERRIDE(pre_inc_obj)
-XDEBUG_OPCODE_OVERRIDE(switch_free)
-XDEBUG_OPCODE_OVERRIDE(qm_assign)
+XDEBUG_OPCODE_OVERRIDE(pre_dec_obj)
+XDEBUG_OPCODE_OVERRIDE(post_inc_obj)
+XDEBUG_OPCODE_OVERRIDE(post_dec_obj)
+XDEBUG_OPCODE_OVERRIDE(assign_obj)
+XDEBUG_OPCODE_OVERRIDE(instanceof)
+XDEBUG_OPCODE_OVERRIDE(declare_class)
+XDEBUG_OPCODE_OVERRIDE(inherited_class)
+XDEBUG_OPCODE_OVERRIDE(declare_function)
+XDEBUG_OPCODE_OVERRIDE(raise_abstract_error)
+XDEBUG_OPCODE_OVERRIDE(add_interface)
+XDEBUG_OPCODE_OVERRIDE(verify_abstract_class)
+XDEBUG_OPCODE_OVERRIDE(assign_dim)
+XDEBUG_OPCODE_OVERRIDE(isset_isempty_prop_obj)
+XDEBUG_OPCODE_OVERRIDE(handle_exception)
+XDEBUG_OPCODE_OVERRIDE(user_opcode)
+#endif
 
 
 PHP_MINIT_FUNCTION(xdebug)
@@ -639,67 +646,139 @@
         old_error_cb = zend_error_cb;
         new_error_cb = xdebug_error_cb;
 
+#ifdef ZEND_ENGINE_2
         /* Get reserved offset */
         XG(reserved_offset) = zend_get_resource_handle(&dummy_ext);
 
         /* Overload the "exit" opcode */
- XDEBUG_SET_OPCODE_OVERRIDE(exit, ZEND_EXIT);
- XDEBUG_SET_OPCODE_OVERRIDE(jmp, ZEND_JMP);
- XDEBUG_SET_OPCODE_OVERRIDE(jmpz, ZEND_JMPZ);
- XDEBUG_SET_OPCODE_OVERRIDE(jmpnz, ZEND_JMPNZ);
- XDEBUG_SET_OPCODE_OVERRIDE(is_identical, ZEND_IS_IDENTICAL);
- XDEBUG_SET_OPCODE_OVERRIDE(is_not_identical, ZEND_IS_NOT_IDENTICAL);
- XDEBUG_SET_OPCODE_OVERRIDE(is_equal, ZEND_IS_EQUAL);
- XDEBUG_SET_OPCODE_OVERRIDE(is_not_equal, ZEND_IS_NOT_EQUAL);
- XDEBUG_SET_OPCODE_OVERRIDE(is_smaller, ZEND_IS_SMALLER);
- XDEBUG_SET_OPCODE_OVERRIDE(is_smaller_or_equal, ZEND_IS_SMALLER_OR_EQUAL);
-
- XDEBUG_SET_OPCODE_OVERRIDE(assign, ZEND_ASSIGN);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_add, ZEND_ASSIGN_ADD);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_sub, ZEND_ASSIGN_SUB);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_mul, ZEND_ASSIGN_MUL);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_div, ZEND_ASSIGN_DIV);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_mod, ZEND_ASSIGN_MOD);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_sl, ZEND_ASSIGN_SL);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_sr, ZEND_ASSIGN_SR);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_concat, ZEND_ASSIGN_CONCAT);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_bw_or, ZEND_ASSIGN_BW_OR);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_bw_and, ZEND_ASSIGN_BW_AND);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_bw_xor, ZEND_ASSIGN_BW_XOR);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_dim, ZEND_ASSIGN_DIM);
- XDEBUG_SET_OPCODE_OVERRIDE(assign_obj, ZEND_ASSIGN_OBJ);
-
- XDEBUG_SET_OPCODE_OVERRIDE(add_array_element, ZEND_ADD_ARRAY_ELEMENT);
- XDEBUG_SET_OPCODE_OVERRIDE(return, ZEND_RETURN);
- XDEBUG_SET_OPCODE_OVERRIDE(ext_stmt, ZEND_EXT_STMT);
- XDEBUG_SET_OPCODE_OVERRIDE(raise_abstract_error, ZEND_RAISE_ABSTRACT_ERROR);
- XDEBUG_SET_OPCODE_OVERRIDE(send_var, ZEND_SEND_VAR);
- XDEBUG_SET_OPCODE_OVERRIDE(send_var_no_ref, ZEND_SEND_VAR_NO_REF);
- XDEBUG_SET_OPCODE_OVERRIDE(send_val, ZEND_SEND_VAL);
- XDEBUG_SET_OPCODE_OVERRIDE(new, ZEND_NEW);
- XDEBUG_SET_OPCODE_OVERRIDE(ext_fcall_begin, ZEND_EXT_FCALL_BEGIN);
- XDEBUG_SET_OPCODE_OVERRIDE(catch, ZEND_CATCH);
- XDEBUG_SET_OPCODE_OVERRIDE(bool, ZEND_BOOL);
- XDEBUG_SET_OPCODE_OVERRIDE(add_string, ZEND_ADD_STRING);
- XDEBUG_SET_OPCODE_OVERRIDE(init_array, ZEND_INIT_ARRAY);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_r, ZEND_FETCH_DIM_R);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_r, ZEND_FETCH_OBJ_R);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_w, ZEND_FETCH_OBJ_W);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_func_arg, ZEND_FETCH_OBJ_FUNC_ARG);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_func_arg, ZEND_FETCH_DIM_FUNC_ARG);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_unset, ZEND_FETCH_DIM_UNSET);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_unset, ZEND_FETCH_OBJ_UNSET);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_class, ZEND_FETCH_CLASS);
- XDEBUG_SET_OPCODE_OVERRIDE(fetch_constant, ZEND_FETCH_CONSTANT);
- XDEBUG_SET_OPCODE_OVERRIDE(concat, ZEND_CONCAT);
- XDEBUG_SET_OPCODE_OVERRIDE(isset_isempty_dim_obj, ZEND_ISSET_ISEMPTY_DIM_OBJ);
- XDEBUG_SET_OPCODE_OVERRIDE(pre_inc_obj, ZEND_PRE_INC_OBJ);
- XDEBUG_SET_OPCODE_OVERRIDE(switch_free, ZEND_SWITCH_FREE);
- XDEBUG_SET_OPCODE_OVERRIDE(qm_assign, ZEND_QM_ASSIGN);
- XDEBUG_SET_OPCODE_OVERRIDE(include_or_eval, ZEND_INCLUDE_OR_EVAL);
+XDEBUG_SET_OPCODE_OVERRIDE(nop, ZEND_NOP)
+XDEBUG_SET_OPCODE_OVERRIDE(add, ZEND_ADD)
+XDEBUG_SET_OPCODE_OVERRIDE(sub, ZEND_SUB)
+XDEBUG_SET_OPCODE_OVERRIDE(mul, ZEND_MUL)
+XDEBUG_SET_OPCODE_OVERRIDE(div, ZEND_DIV)
+XDEBUG_SET_OPCODE_OVERRIDE(mod, ZEND_MOD)
+XDEBUG_SET_OPCODE_OVERRIDE(sl, ZEND_SL)
+XDEBUG_SET_OPCODE_OVERRIDE(sr, ZEND_SR)
+XDEBUG_SET_OPCODE_OVERRIDE(concat, ZEND_CONCAT)
+XDEBUG_SET_OPCODE_OVERRIDE(bw_or, ZEND_BW_OR)
+XDEBUG_SET_OPCODE_OVERRIDE(bw_and, ZEND_BW_AND)
+XDEBUG_SET_OPCODE_OVERRIDE(bw_xor, ZEND_BW_XOR)
+XDEBUG_SET_OPCODE_OVERRIDE(bw_not, ZEND_BW_NOT)
+XDEBUG_SET_OPCODE_OVERRIDE(bool_not, ZEND_BOOL_NOT)
+XDEBUG_SET_OPCODE_OVERRIDE(bool_xor, ZEND_BOOL_XOR)
+XDEBUG_SET_OPCODE_OVERRIDE(is_identical, ZEND_IS_IDENTICAL)
+XDEBUG_SET_OPCODE_OVERRIDE(is_not_identical, ZEND_IS_NOT_IDENTICAL)
+XDEBUG_SET_OPCODE_OVERRIDE(is_equal, ZEND_IS_EQUAL)
+XDEBUG_SET_OPCODE_OVERRIDE(is_not_equal, ZEND_IS_NOT_EQUAL)
+XDEBUG_SET_OPCODE_OVERRIDE(is_smaller, ZEND_IS_SMALLER)
+XDEBUG_SET_OPCODE_OVERRIDE(is_smaller_or_equal, ZEND_IS_SMALLER_OR_EQUAL)
+XDEBUG_SET_OPCODE_OVERRIDE(cast, ZEND_CAST )
+XDEBUG_SET_OPCODE_OVERRIDE(qm_assign, ZEND_QM_ASSIGN )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_add,ZEND_ASSIGN_ADD )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_sub, ZEND_ASSIGN_SUB )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_mul, ZEND_ASSIGN_MUL )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_div, ZEND_ASSIGN_DIV )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_mod, ZEND_ASSIGN_MOD )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_sl, ZEND_ASSIGN_SL )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_sr, ZEND_ASSIGN_SR )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_concat, ZEND_ASSIGN_CONCAT )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_bw_or, ZEND_ASSIGN_BW_OR )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_bw_and, ZEND_ASSIGN_BW_AND )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_bw_xor, ZEND_ASSIGN_BW_XOR )
+XDEBUG_SET_OPCODE_OVERRIDE(pre_inc, ZEND_PRE_INC )
+XDEBUG_SET_OPCODE_OVERRIDE(pre_dec, ZEND_PRE_DEC )
+XDEBUG_SET_OPCODE_OVERRIDE(post_inc, ZEND_POST_INC )
+XDEBUG_SET_OPCODE_OVERRIDE(post_dec, ZEND_POST_DEC )
+XDEBUG_SET_OPCODE_OVERRIDE(assign, ZEND_ASSIGN )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_ref, ZEND_ASSIGN_REF )
+XDEBUG_SET_OPCODE_OVERRIDE(echo, ZEND_ECHO )
+XDEBUG_SET_OPCODE_OVERRIDE(print, ZEND_PRINT )
+XDEBUG_SET_OPCODE_OVERRIDE(jmp, ZEND_JMP )
+XDEBUG_SET_OPCODE_OVERRIDE(jmpz, ZEND_JMPZ )
+XDEBUG_SET_OPCODE_OVERRIDE(jmpnz, ZEND_JMPNZ )
+XDEBUG_SET_OPCODE_OVERRIDE(jmpz_ex, ZEND_JMPZ_EX )
+XDEBUG_SET_OPCODE_OVERRIDE(jmpnz_ex, ZEND_JMPNZ_EX )
+XDEBUG_SET_OPCODE_OVERRIDE(case,ZEND_CASE )
+XDEBUG_SET_OPCODE_OVERRIDE(switch_free, ZEND_SWITCH_FREE )
+XDEBUG_SET_OPCODE_OVERRIDE(bool, ZEND_BOOL )
+XDEBUG_SET_OPCODE_OVERRIDE(init_string, ZEND_INIT_STRING )
+XDEBUG_SET_OPCODE_OVERRIDE(add_char, ZEND_ADD_CHAR )
+XDEBUG_SET_OPCODE_OVERRIDE(add_string, ZEND_ADD_STRING )
+XDEBUG_SET_OPCODE_OVERRIDE(add_var, ZEND_ADD_VAR )
+XDEBUG_SET_OPCODE_OVERRIDE(begin_silence, ZEND_BEGIN_SILENCE )
+XDEBUG_SET_OPCODE_OVERRIDE(end_silence, ZEND_END_SILENCE )
+XDEBUG_SET_OPCODE_OVERRIDE(init_fcall_by_name, ZEND_INIT_FCALL_BY_NAME )
+XDEBUG_SET_OPCODE_OVERRIDE(do_fcall, ZEND_DO_FCALL )
+XDEBUG_SET_OPCODE_OVERRIDE(do_fcall_by_name, ZEND_DO_FCALL_BY_NAME )
+XDEBUG_SET_OPCODE_OVERRIDE(return, ZEND_RETURN )
+XDEBUG_SET_OPCODE_OVERRIDE(recv, ZEND_RECV )
+XDEBUG_SET_OPCODE_OVERRIDE(recv_init, ZEND_RECV_INIT )
+XDEBUG_SET_OPCODE_OVERRIDE(send_val, ZEND_SEND_VAL )
+XDEBUG_SET_OPCODE_OVERRIDE(send_var, ZEND_SEND_VAR )
+XDEBUG_SET_OPCODE_OVERRIDE(send_re, ZEND_SEND_REF )
+XDEBUG_SET_OPCODE_OVERRIDE(new, ZEND_NEW )
+XDEBUG_SET_OPCODE_OVERRIDE(free, ZEND_FREE )
+XDEBUG_SET_OPCODE_OVERRIDE(init_array, ZEND_INIT_ARRAY )
+XDEBUG_SET_OPCODE_OVERRIDE(add_array_element, ZEND_ADD_ARRAY_ELEMENT )
+XDEBUG_SET_OPCODE_OVERRIDE(include_or_eval, ZEND_INCLUDE_OR_EVAL )
+XDEBUG_SET_OPCODE_OVERRIDE(unset_var, ZEND_UNSET_VAR )
+XDEBUG_SET_OPCODE_OVERRIDE(unset_dim, ZEND_UNSET_DIM )
+XDEBUG_SET_OPCODE_OVERRIDE(unset_obj, ZEND_UNSET_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(fe_reset, ZEND_FE_RESET )
+XDEBUG_SET_OPCODE_OVERRIDE(fe_fetch, ZEND_FE_FETCH )
+XDEBUG_SET_OPCODE_OVERRIDE(exit, ZEND_EXIT )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_r, ZEND_FETCH_R )
+XDEBUG_SET_OPCODE_OVERRIDE(dim_r, ZEND_FETCH_DIM_R )
+XDEBUG_SET_OPCODE_OVERRIDE(obj_r, ZEND_FETCH_OBJ_R )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_w, ZEND_FETCH_W )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_w, ZEND_FETCH_DIM_W )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_w, ZEND_FETCH_OBJ_W )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_rw, ZEND_FETCH_RW )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_rw, ZEND_FETCH_DIM_RW )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_rw, ZEND_FETCH_OBJ_RW )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_is, ZEND_FETCH_IS )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_is, ZEND_FETCH_DIM_IS )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_is, ZEND_FETCH_OBJ_IS )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_func_arg, ZEND_FETCH_FUNC_ARG )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_func_arg, ZEND_FETCH_DIM_FUNC_ARG )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_func_arg, ZEND_FETCH_OBJ_FUNC_ARG )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_unset, ZEND_FETCH_UNSET )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_unset, ZEND_FETCH_DIM_UNSET )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_obj_unset, ZEND_FETCH_OBJ_UNSET )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_dim_tmp_var, ZEND_FETCH_DIM_TMP_VAR )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_constant, ZEND_FETCH_CONSTANT )
+XDEBUG_SET_OPCODE_OVERRIDE(ext_stmt, ZEND_EXT_STMT )
+XDEBUG_SET_OPCODE_OVERRIDE(ext_call_begin, ZEND_EXT_FCALL_BEGIN )
+XDEBUG_SET_OPCODE_OVERRIDE(ext_call_end, ZEND_EXT_FCALL_END )
+XDEBUG_SET_OPCODE_OVERRIDE(ext_nop, ZEND_EXT_NOP )
+XDEBUG_SET_OPCODE_OVERRIDE(ticks, ZEND_TICKS )
+XDEBUG_SET_OPCODE_OVERRIDE(send_var_no_ref, ZEND_SEND_VAR_NO_REF )
+XDEBUG_SET_OPCODE_OVERRIDE(catch, ZEND_CATCH )
+XDEBUG_SET_OPCODE_OVERRIDE(throw, ZEND_THROW )
+XDEBUG_SET_OPCODE_OVERRIDE(fetch_class, ZEND_FETCH_CLASS )
+XDEBUG_SET_OPCODE_OVERRIDE(clone, ZEND_CLONE )
+XDEBUG_SET_OPCODE_OVERRIDE(init_method_call, ZEND_INIT_METHOD_CALL )
+XDEBUG_SET_OPCODE_OVERRIDE(init_static_method_call, ZEND_INIT_STATIC_METHOD_CALL)
+XDEBUG_SET_OPCODE_OVERRIDE(isset_isempty_var, ZEND_ISSET_ISEMPTY_VAR )
+XDEBUG_SET_OPCODE_OVERRIDE(isset_isempty_dim_obj, ZEND_ISSET_ISEMPTY_DIM_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(pre_inc_obj, ZEND_PRE_INC_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(pre_dec_obj, ZEND_PRE_DEC_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(post_inc_obj, ZEND_POST_INC_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(post_dec_obj, ZEND_POST_DEC_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(assign_obj, ZEND_ASSIGN_OBJ )
+XDEBUG_SET_OPCODE_OVERRIDE(instanceof, ZEND_INSTANCEOF )
+XDEBUG_SET_OPCODE_OVERRIDE(declare_class, ZEND_DECLARE_CLASS)
+XDEBUG_SET_OPCODE_OVERRIDE(inherited_class, ZEND_DECLARE_INHERITED_CLASS)
+XDEBUG_SET_OPCODE_OVERRIDE(declare_function, ZEND_DECLARE_FUNCTION)
+XDEBUG_SET_OPCODE_OVERRIDE(raise_abstract_error, ZEND_RAISE_ABSTRACT_ERROR)
+XDEBUG_SET_OPCODE_OVERRIDE(add_interface, ZEND_ADD_INTERFACE)
+XDEBUG_SET_OPCODE_OVERRIDE(verify_abstract_class, ZEND_VERIFY_ABSTRACT_CLASS)
+XDEBUG_SET_OPCODE_OVERRIDE(assign_dim, ZEND_ASSIGN_DIM)
+XDEBUG_SET_OPCODE_OVERRIDE(isset_isempty_prop_obj, ZEND_ISSET_ISEMPTY_PROP_OBJ)
+XDEBUG_SET_OPCODE_OVERRIDE(handle_exception, ZEND_HANDLE_EXCEPTION)
+XDEBUG_SET_OPCODE_OVERRIDE(user_opcode, ZEND_USER_OPCODE)
 
- XDEBUG_SET_OPCODE_OVERRIDE(silence, ZEND_BEGIN_SILENCE);
- XDEBUG_SET_OPCODE_OVERRIDE(silence, ZEND_END_SILENCE);
+#endif
 
         if (zend_xdebug_initialised == 0) {
                 zend_error(E_WARNING, "Xdebug MUST be loaded as a Zend extension");
@@ -711,6 +790,10 @@
 
         REGISTER_LONG_CONSTANT("XDEBUG_CC_UNUSED", XDEBUG_CC_OPTION_UNUSED, CONST_CS | CONST_PERSISTENT);
         REGISTER_LONG_CONSTANT("XDEBUG_CC_DEAD_CODE", XDEBUG_CC_OPTION_DEAD_CODE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XDEBUG_CC_OPTION_DUMP_INSTRUCTION_COUNTS", XDEBUG_CC_OPTION_DUMP_INSTRUCTION_COUNTS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XDEBUG_CC_OPTION_BRANCH_ANALYSIS", XDEBUG_CC_OPTION_BRANCH_ANALYSIS, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("XDEBUG_CC_OPTION_PATH_ANALYSIS", XDEBUG_CC_OPTION_PATH_ANALYSIS, CONST_CS | CONST_PERSISTENT);
+
 
         XG(breakpoint_count) = 0;
         return SUCCESS;
@@ -740,15 +823,6 @@
         return SUCCESS;
 }
 
-static void xdebug_collected_error_dtor(void *dummy, void *elem)
-{
- char *s = elem;
-
- if (s) {
- xdfree(s);
- }
-}
-
 static void xdebug_used_var_dtor(void *dummy, void *elem)
 {
         char *s = elem;
@@ -833,9 +907,6 @@
         XG(function_count) = 0;
         XG(active_symbol_table) = NULL;
         XG(last_exception_trace) = NULL;
- XG(last_eval_statement) = NULL;
- XG(do_collect_errors) = 0;
- XG(collected_errors) = xdebug_llist_alloc(xdebug_collected_error_dtor);
         
         if (idekey && *idekey) {
                 if (XG(ide_key)) {
@@ -844,11 +915,6 @@
                 XG(ide_key) = xdstrdup(idekey);
         }
 
- /* This is to kick the global variable JIT-mechanism in PHP */
-#ifdef ZEND_ENGINE_2
- zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
-#endif
-
         /* Check if we have this special get variable that stops a debugging
          * request without executing any code */
         if (
@@ -863,7 +929,7 @@
                 )
                 && !SG(headers_sent)
         ) {
- php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), "", 0, time(NULL) + XG(remote_cookie_expire_time), "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 XG(no_exec) = 1;
         }
 
@@ -876,7 +942,10 @@
 
         if (XG(default_enable)) {
                 zend_error_cb = new_error_cb;
+
+#ifdef ZEND_ENGINE_2
                 zend_throw_exception_hook = xdebug_throw_exception_hook;
+#endif
         }
         XG(remote_enabled) = 0;
         XG(profiler_enabled) = 0;
@@ -903,34 +972,28 @@
         XG(start_time) = xdebug_get_utime();
 
         /* Override var_dump with our own function */
- XG(var_dump_overloaded) = 0;
- if (XG(overload_var_dump)) {
- zend_hash_find(EG(function_table), "var_dump", 9, (void **)&orig);
- XG(orig_var_dump_func) = orig->internal_function.handler;
- orig->internal_function.handler = zif_xdebug_var_dump;
- XG(var_dump_overloaded) = 1;
- }
+ zend_hash_find(EG(function_table), "var_dump", 9, (void **)&orig);
+ XG(orig_var_dump_func) = orig->internal_function.handler;
+ orig->internal_function.handler = zif_xdebug_var_dump;
 
         /* Override set_time_limit with our own function to prevent timing out while debugging */
         zend_hash_find(EG(function_table), "set_time_limit", 15, (void **)&orig);
         XG(orig_set_time_limit_func) = orig->internal_function.handler;
         orig->internal_function.handler = zif_xdebug_set_time_limit;
 
- /* Override header generation in SAPI */
- XG(orig_header_handler) = sapi_module.header_handler;
- sapi_module.header_handler = xdebug_header_handler;
- XG(headers) = xdebug_llist_alloc(NULL);
- if (strcmp(sapi_module.name, "cli") == 0) {
- SG(request_info).no_headers = 1;
- }
-
         return SUCCESS;
 }
 
+#ifdef ZEND_ENGINE_2
 ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xdebug)
 {
         zend_function *orig;
         TSRMLS_FETCH();
+#else
+PHP_RSHUTDOWN_FUNCTION(xdebug)
+{
+ zend_function *orig;
+#endif
 
         if (XG(remote_enabled)) {
                 XG(context).handler->remote_deinit(&(XG(context)));
@@ -974,25 +1037,12 @@
                 xdfree(XG(last_exception_trace));
         }
 
- if (XG(last_eval_statement)) {
- efree(XG(last_eval_statement));
- }
-
- xdebug_llist_destroy(XG(collected_errors), NULL);
-
         /* Reset var_dump and set_time_limit to the original function */
- if (XG(var_dump_overloaded)) {
- zend_hash_find(EG(function_table), "var_dump", 9, (void **)&orig);
- orig->internal_function.handler = XG(orig_var_dump_func);
- }
+ zend_hash_find(EG(function_table), "var_dump", 9, (void **)&orig);
+ orig->internal_function.handler = XG(orig_var_dump_func);
         zend_hash_find(EG(function_table), "set_time_limit", 15, (void **)&orig);
         orig->internal_function.handler = XG(orig_set_time_limit_func);
 
- /* Clean up collected headers */
- xdebug_llist_destroy(XG(headers), NULL);
-
- sapi_module.header_handler = XG(orig_header_handler);
-
         return SUCCESS;
 }
 
@@ -1029,6 +1079,17 @@
 
         if (edata) {
                 if (edata->function_state.function->common.function_name) {
+#if ZEND_EXTENSION_API_NO < 90000000
+ if (edata->ce) {
+ tmp->type = XFUNC_STATIC_MEMBER;
+ tmp->class = xdstrdup(edata->ce->name);
+ } else if (edata->object.ptr) {
+ tmp->type = XFUNC_MEMBER;
+ tmp->class = xdstrdup(edata->object.ptr->value.obj.ce->name);
+ } else {
+ tmp->type = XFUNC_NORMAL;
+ }
+#else
                         if (edata->object) {
                                 tmp->type = XFUNC_MEMBER;
                                 if (edata->function_state.function->common.scope) { /* __autoload has no scope */
@@ -1040,6 +1101,7 @@
                         } else {
                                 tmp->type = XFUNC_NORMAL;
                         }
+#endif
                         tmp->function = xdstrdup(edata->function_state.function->common.function_name);
                 } else {
                         switch (edata->opline->op2.u.constant.value.lval) {
@@ -1174,11 +1236,18 @@
                         tmp->lineno = 0;
                 }
 
+#if (PHP_MAJOR_VERSION == 6) || \
+ (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || \
+ (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 0 && PHP_RELEASE_VERSION > 3) || \
+ (PHP_MAJOR_VERSION == 4 && PHP_MINOR_VERSION == 4 && PHP_RELEASE_VERSION > 0)
                 if (tmp->function.type == XFUNC_EVAL) {
- tmp->include_filename = xdebug_sprintf("'%s'", XG(last_eval_statement));
+ int is_var;
+
+ tmp->include_filename = xdebug_get_zval_value(get_zval(zdata, &zdata->opline->op1, zdata->Ts, &is_var), 0, NULL);
                 } else if (XG(collect_includes)) {
                         tmp->include_filename = xdstrdup(zend_get_executed_filename(TSRMLS_C));
                 }
+#endif
         } else {
                 if (edata->opline) {
                         cur_opcode = edata->opline;
@@ -1216,9 +1285,11 @@
                         }
 #endif
 
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
                         if (tmp->user_defined == XDEBUG_EXTERNAL) {
                                 arguments_wanted = op_array->num_args;
                         }
+# endif
 
                         if (arguments_wanted > arguments_sent) {
                                 arguments_storage = arguments_wanted;
@@ -1230,7 +1301,7 @@
                         for (i = 0; i < arguments_sent; i++) {
                                 tmp->var[tmp->varc].name = NULL;
                                 tmp->var[tmp->varc].addr = NULL;
-
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
                                 /* Because it is possible that more parameters are sent, then
                                  * actually wanted we can only access the name in case there
                                  * is an associated variable to receive the variable here. */
@@ -1239,7 +1310,7 @@
                                                 tmp->var[tmp->varc].name = xdstrdup(op_array->arg_info[i].name);
                                         }
                                 }
-
+# endif
                                 if (XG(collect_params)) {
 #if PHP_VERSION_ID >= 50300
                                         if (p) {
@@ -1258,6 +1329,7 @@
                                 tmp->varc++;
                         }
 
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
                         /* Sometimes not enough arguments are send to a user defined
                          * function, so we have to gather only the name for those extra. */
                         if (tmp->user_defined == XDEBUG_EXTERNAL && arguments_sent < arguments_wanted) {
@@ -1269,12 +1341,13 @@
                                         tmp->varc++;
                                 }
                         }
+# endif
                 }
         }
 
- if (XG(do_code_coverage)) {
- xdebug_count_line(tmp->filename, tmp->lineno, 0, 0 TSRMLS_CC);
- }
+ /*if (XG(do_code_coverage)) {
+
+ }*/
 
         if (XG(profiler_aggregate)) {
                 char *func_name = xdebug_show_fname(tmp->function, 0, 0 TSRMLS_CC);
@@ -1331,26 +1404,24 @@
 static void add_used_variables(function_stack_entry *fse, zend_op_array *op_array)
 {
         int i = 0;
+ int j = op_array->size;
 
         if (!fse->used_vars) {
                 fse->used_vars = xdebug_llist_alloc(xdebug_used_var_dtor);
         }
 
         /* Check parameters */
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
         for (i = 0; i < fse->varc; i++) {
                 if (fse->var[i].name) {
                         xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(fse->var[i].name));
                 }
         }
-
- /* gather used variables from compiled vars information */
- while (i < op_array->last_var) {
- xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(op_array->vars[i].name));
- i++;
- }
+# endif
 
         /* opcode scanning time */
- while (i < op_array->size) {
+ while (i < j) {
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
                 char *cv = NULL;
                 int cv_len;
 
@@ -1362,6 +1433,24 @@
                         cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].op2.u.var, &cv_len);
                         xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv));
                 }
+#else
+ if (op_array->opcodes[i].opcode == ZEND_FETCH_R || op_array->opcodes[i].opcode == ZEND_FETCH_W) {
+ if (op_array->opcodes[i].op1.op_type == IS_CONST) {
+ if (Z_TYPE(op_array->opcodes[i].op1.u.constant) == IS_STRING) {
+ xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(op_array->opcodes[i].op1.u.constant.value.str.val));
+ } else { /* unusual but not impossible situation */
+ int use_copy;
+ zval tmp_zval;
+
+ zend_make_printable_zval(&(op_array->opcodes[i].op1.u.constant), &tmp_zval, &use_copy);
+
+ xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(tmp_zval.value.str.val));
+
+ zval_dtor(&tmp_zval);
+ }
+ }
+ }
+#endif
                 i++;
         }
 }
@@ -1451,6 +1540,7 @@
         int function_nr = 0;
         xdebug_llist_element *le;
         int eval_id = 0;
+ zval *return_val = NULL;
 
 
         if (XG(no_exec) == 1) {
@@ -1480,7 +1570,7 @@
                                 xdfree(XG(ide_key));
                         }
                         XG(ide_key) = xdstrdup(Z_STRVAL_PP(dummy));
- php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), Z_STRVAL_PP(dummy), Z_STRLEN_PP(dummy), time(NULL) + XG(remote_cookie_expire_time), "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), Z_STRVAL_PP(dummy), Z_STRLEN_PP(dummy), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 } else if (
                         PG(http_globals)[TRACK_VARS_COOKIE] &&
                         zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), (void **) &dummy) == SUCCESS
@@ -1494,7 +1584,7 @@
                 } else if (getenv("XDEBUG_CONFIG")) {
                         magic_cookie = xdstrdup(getenv("XDEBUG_CONFIG"));
                         if (XG(ide_key) && *XG(ide_key) && !SG(headers_sent)) {
- php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), XG(ide_key), strlen(XG(ide_key)), time(NULL) + XG(remote_cookie_expire_time), "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), XG(ide_key), strlen(XG(ide_key)), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                         }
                 }
                         
@@ -1516,7 +1606,7 @@
                                 xdfree(magic_cookie);
                                 magic_cookie = NULL;
                         }
- php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), "", 0, time(NULL) + XG(remote_cookie_expire_time), "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 }
 
                 /* Start remote context if requested */
@@ -1527,13 +1617,7 @@
                         (XG(remote_mode) == XDEBUG_REQ)
                 ) {
                         /* Initialize debugging session */
- if (XG(remote_connect_back)) {
- zval **remote_addr = NULL;
- zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REMOTE_ADDR", 12, (void**)&remote_addr);
- XG(context).socket = xdebug_create_socket(Z_STRVAL_PP(remote_addr), XG(remote_port));
- } else {
- XG(context).socket = xdebug_create_socket(XG(remote_host), XG(remote_port));
- }
+ XG(context).socket = xdebug_create_socket(XG(remote_host), XG(remote_port));
                         if (XG(context).socket >= 0) {
                                 XG(remote_enabled) = 1;
 
@@ -1613,10 +1697,8 @@
                         }
                 }
         }
-
- if (XG(do_code_coverage) && XG(code_coverage_unused)) {
                 xdebug_prefill_code_coverage(op_array TSRMLS_CC);
- }
+
 
         /* If we're in an eval, we need to create an ID for it. This ID however
          * depends on the debugger mechanism in use so we need to call a function
@@ -1635,6 +1717,11 @@
         if (XG(profiler_enabled)) {
                 xdebug_profiler_function_user_begin(fse TSRMLS_CC);
         }
+
+ if (EG(return_value_ptr_ptr) == NULL) {
+ EG(return_value_ptr_ptr) = &return_val;
+ }
+
         xdebug_old_execute(op_array TSRMLS_CC);
 
         if (XG(profiler_enabled)) {
@@ -1653,6 +1740,11 @@
                 }
         }
 
+ if (return_val) {
+ zval_ptr_dtor(&return_val);
+ EG(return_value_ptr_ptr) = NULL;
+ }
+
         /* Check for return breakpoints */
         if (XG(remote_enabled) && XG(breakpoints_allowed)) {
                 if (!handle_breakpoints(fse, XDEBUG_BRK_FUNC_RETURN)) {
@@ -1747,8 +1839,8 @@
         " $%s = *uninitialized*\n"
 };
 
-static char* html_formats[12] = {
- "<br />\n<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>\n",
+static char* html_formats[10] = {
+ "<br />\n<font size='1'><table dir='ltr' border='1' cellspacing='0' cellpadding='1'>\n",
         "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> %s: %s in %s on line <i>%d</i></th></tr>\n",
 #if HAVE_PHP_MEMORY_USAGE
         "<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\n",
@@ -1766,9 +1858,7 @@
 #endif
         "</table></font>\n",
         "<tr><td colspan='2' align='right' bgcolor='#eeeeec' valign='top'><pre>$%s&nbsp;=</pre></td><td colspan='4' bgcolor='#eeeeec'>%s</td></tr>\n",
- "<tr><td bgcolor='#eeeeec'>$%s</td><td colspan='4' bgcolor='#eeeeec' colspan='2'><i>Undefined</i></td></tr>\n",
- " )</td><td title='%s' bgcolor='#eeeeec'><a style='color: black' href='%s'>..%s<b>:</b>%d</a></td></tr>\n",
- "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> %s: %s in <a style='color: black' href='%s'>%s</a> on line <i>%d</i></th></tr>\n"
+ "<tr><td bgcolor='#eeeeec'>$%s</td><td colspan='4' bgcolor='#eeeeec' colspan='2'><i>Undefined</i></td></tr>\n"
 };
 
 static void dump_used_var_with_contents(void *htmlq, xdebug_hash_element* he, void *argument)
@@ -1877,40 +1967,6 @@
         }
 }
 
-static int create_file_link(char **filename, const char *error_filename, int error_lineno TSRMLS_DC)
-{
- xdebug_str fname = {0, 0, NULL};
- char *format = XG(file_link_format);
-
- while (*format)
- {
- if (*format != '%') {
- xdebug_str_addl(&fname, (char *) format, 1, 0);
- } else {
- format++;
- switch (*format)
- {
- case 'f': /* filename */
- xdebug_str_add(&fname, xdebug_sprintf("%s", error_filename), 1);
- break;
-
- case 'l': /* line number */
- xdebug_str_add(&fname, xdebug_sprintf("%d", error_lineno), 1);
- break;
-
- case '%': /* literal % */
- xdebug_str_addl(&fname, "%", 1, 0);
- break;
- }
- }
- format++;
- }
-
- *filename = fname.d;
-
- return fname.l;
-}
-
 static char* get_printable_stack(int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC)
 {
         xdebug_llist_element *le;
@@ -1918,8 +1974,6 @@
         int len;
         char **formats;
         xdebug_str str = {0, 0, NULL};
- char *prepend_string;
- char *append_string;
 
         if (html) {
                 formats = html_formats;
@@ -1927,21 +1981,9 @@
                 formats = text_formats;
         }
 
- prepend_string = INI_STR("error_prepend_string");
- append_string = INI_STR("error_append_string");
-
- xdebug_str_add(&str, prepend_string ? prepend_string : "", 0);
         xdebug_str_add(&str, formats[0], 0);
 
- if (strlen(XG(file_link_format)) > 0 && html) {
- char *file_link;
-
- create_file_link(&file_link, error_filename, error_lineno TSRMLS_CC);
- xdebug_str_add(&str, xdebug_sprintf(formats[11], error_type_str, buffer, file_link, error_filename, error_lineno), 1);
- xdfree(file_link);
- } else {
- xdebug_str_add(&str, xdebug_sprintf(formats[1], error_type_str, buffer, error_filename, error_lineno), 1);
- }
+ xdebug_str_add(&str, xdebug_sprintf(formats[1], error_type_str, buffer, error_filename, error_lineno), 1);
 
         if (XG(stack) && XG(stack)->size) {
                 i = XDEBUG_LLIST_VALP(XDEBUG_LLIST_HEAD(XG(stack)));
@@ -2038,18 +2080,8 @@
                         }
 
                         if (html) {
- if (strlen(XG(file_link_format)) > 0) {
- char *just_filename = strrchr(i->filename, DEFAULT_SLASH);
- char *file_link;
-
- create_file_link(&file_link, i->filename, i->lineno TSRMLS_CC);
- xdebug_str_add(&str, xdebug_sprintf(formats[10], i->filename, file_link, just_filename, i->lineno), 1);
- xdfree(file_link);
- } else {
- char *just_filename = strrchr(i->filename, DEFAULT_SLASH);
-
- xdebug_str_add(&str, xdebug_sprintf(formats[5], i->filename, just_filename, i->lineno), 1);
- }
+ char *just_filename = strrchr(i->filename, DEFAULT_SLASH);
+ xdebug_str_add(&str, xdebug_sprintf(formats[5], i->filename, just_filename, i->lineno), 1);
                         } else {
                                 xdebug_str_add(&str, xdebug_sprintf(formats[5], i->filename, i->lineno), 1);
                         }
@@ -2083,41 +2115,17 @@
                 }
 
                 xdebug_str_add(&str, formats[7], 0);
- xdebug_str_add(&str, append_string ? append_string : "", 0);
         }
         return str.d;
 }
 
-static char* return_trace_assignment(function_stack_entry *i, char *varname, zval *retval, char *op, char *filename, int lineno TSRMLS_DC)
+static void print_stack(int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC)
 {
- int j = 0;
- xdebug_str str = {0, 0, NULL};
- char *tmp_value;
+ char *printable_stack;
 
- if (XG(trace_format) != 0) {
- return xdstrdup("");
- }
-
- xdebug_str_addl(&str, " ", 20, 0);
- if (XG(show_mem_delta)) {
- xdebug_str_addl(&str, " ", 8, 0);
- }
- for (j = 0; j < i->level; j++) {
- xdebug_str_addl(&str, " ", 2, 0);
- }
- xdebug_str_addl(&str, " => $", 7, 0);
-
- xdebug_str_add(&str, varname, 0);
- xdebug_str_add(&str, xdebug_sprintf(" %s ", op), 1);
- tmp_value = xdebug_get_zval_value(retval, 0, NULL);
- if (tmp_value) {
- xdebug_str_add(&str, tmp_value, 1);
- } else {
- xdebug_str_addl(&str, "NULL", 4, 0);
- }
- xdebug_str_add(&str, xdebug_sprintf(" %s:%d\n", filename, lineno), 1);
-
- return str.d;
+ printable_stack = get_printable_stack(html, error_type_str, buffer, error_filename, error_lineno TSRMLS_CC);
+ php_printf("%s", printable_stack);
+ xdfree(printable_stack);
 }
 
 static char* return_trace_stack_retval(function_stack_entry* i, zval* retval TSRMLS_DC)
@@ -2239,46 +2247,7 @@
                         xdebug_str_add(&str, i->include_filename, 0);
                 }
 
- /* Filename and Lineno (9, 10) */
- xdebug_str_add(&str, xdebug_sprintf("\t%s\t%d", i->filename, i->lineno), 1);
-
-
- if (XG(collect_params) > 0) {
- int j = 0; /* Counter */
-
- /* Nr of arguments (11) */
- xdebug_str_add(&str, xdebug_sprintf("\t%d", i->varc), 1);
-
- /* Arguments (12-...) */
- for (j = 0; j < i->varc; j++) {
- char *tmp_value;
-
- xdebug_str_addl(&str, "\t", 1, 0);
-
- if (i->var[j].name && XG(collect_params) >= 4) {
- xdebug_str_add(&str, xdebug_sprintf("$%s = ", i->var[j].name), 1);
- }
-
- switch (XG(collect_params)) {
- case 1: // synopsis
- case 2:
- tmp_value = xdebug_get_zval_synopsis(i->var[j].addr, 0, NULL);
- break;
- case 3:
- default:
- tmp_value = xdebug_get_zval_value(i->var[j].addr, 0, NULL);
- break;
- }
- if (tmp_value) {
- xdebug_str_add(&str, tmp_value, 1);
- } else {
- xdebug_str_add(&str, "???", 0);
- }
- }
- }
-
- /* Trailing \n */
- xdebug_str_add(&str, "\n", 0);
+ xdebug_str_add(&str, xdebug_sprintf("\t%s\t%d\n", i->filename, i->lineno), 1);
 
         } else if (whence == 1) { /* end */
                 xdebug_str_add(&str, "1\t", 0);
@@ -2354,13 +2323,7 @@
 static void xdebug_do_jit(TSRMLS_D)
 {
         if (!XG(remote_enabled) && XG(remote_enable) && (XG(remote_mode) == XDEBUG_JIT)) {
- if (XG(remote_connect_back)) {
- zval **remote_addr = NULL;
- zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "REMOTE_ADDR", 12, (void**)&remote_addr);
- XG(context).socket = xdebug_create_socket(Z_STRVAL_PP(remote_addr), XG(remote_port));
- } else {
- XG(context).socket = xdebug_create_socket(XG(remote_host), XG(remote_port));
- }
+ XG(context).socket = xdebug_create_socket(XG(remote_host), XG(remote_port));
                 if (XG(context).socket >= 0) {
                         XG(remote_enabled) = 0;
 
@@ -2379,6 +2342,7 @@
         }
 }
 
+#ifdef ZEND_ENGINE_2
 void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
 {
         zval *message, *file, *line;
@@ -2390,17 +2354,17 @@
                 return;
         }
 
+#if (PHP_MAJOR_VERSION >= 6) || ((PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION >= 2))
         default_ce = zend_exception_get_default(TSRMLS_C);
+#else
+ default_ce = zend_exception_get_default();
+#endif
         exception_ce = zend_get_class_entry(exception TSRMLS_CC);
 
         message = zend_read_property(default_ce, exception, "message", sizeof("message")-1, 0 TSRMLS_CC);
         file = zend_read_property(default_ce, exception, "file", sizeof("file")-1, 0 TSRMLS_CC);
         line = zend_read_property(default_ce, exception, "line", sizeof("line")-1, 0 TSRMLS_CC);
 
- if (Z_TYPE_P(message) != IS_STRING || Z_TYPE_P(file) != IS_STRING || Z_TYPE_P(line) != IS_LONG) {
- php_error(E_ERROR, "Your exception class uses incorrect types for common properties: 'message' and 'file' need to be a string and 'line' needs to be an integer.");
- }
-
         exception_trace = get_printable_stack(PG(html_errors), exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line) TSRMLS_CC);
         if (XG(last_exception_trace)) {
                 xdfree(XG(last_exception_trace));
@@ -2438,16 +2402,23 @@
                 xdebug_profiler_deinit(TSRMLS_C);
         }
         
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
         return ZEND_USER_OPCODE_DISPATCH;
+#else
+ return old_exit_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+#endif
 }
+#endif
 
 void xdebug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
 {
         char *buffer, *error_type_str;
         int buffer_len;
         xdebug_brk_info *extra_brk_info = NULL;
+#if PHP_MAJOR_VERSION >= 5
         error_handling_t error_handling;
         zend_class_entry *exception_class;
+#endif
 
         TSRMLS_FETCH();
 
@@ -2455,6 +2426,7 @@
 
         error_type_str = xdebug_error_type(type);
 
+#if PHP_MAJOR_VERSION >= 5
         /* Store last error message for error_get_last() */
         if (PG(last_error_message)) {
                 free(PG(last_error_message));
@@ -2468,7 +2440,9 @@
         PG(last_error_message) = strdup(buffer);
         PG(last_error_file) = strdup(error_filename);
         PG(last_error_lineno) = error_lineno;
+#endif
 
+#if PHP_MAJOR_VERSION >= 5
 #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
         error_handling = EG(error_handling);
         exception_class = EG(exception_class);
@@ -2477,7 +2451,7 @@
         exception_class = PG(exception_class);
 #endif
         /* according to error handling mode, suppress error, throw exception or show it */
- if (error_handling != EH_NORMAL && EG(in_execution)) {
+ if (error_handling != EH_NORMAL) {
                 switch (type) {
                         case E_CORE_ERROR:
                         case E_COMPILE_ERROR:
@@ -2496,12 +2470,17 @@
                                  * but DO NOT overwrite a pending exception
                                  */
                                 if (error_handling == EH_THROW && !EG(exception)) {
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
                                         zend_throw_error_exception(exception_class, buffer, 0, type TSRMLS_CC);
+#else
+ zend_throw_exception(exception_class, buffer, 0 TSRMLS_CC);
+#endif
                                 }
                                 efree(buffer);
                                 return;
                 }
         }
+#endif
 
         if (EG(error_reporting) & type) {
                 /* Log to logger */
@@ -2528,11 +2507,6 @@
                                 xdfree(printable_stack);
                         }
                 }
- if (XG(do_collect_errors)) {
- char *printable_stack;
- printable_stack = get_printable_stack(PG(html_errors), error_type_str, buffer, error_filename, error_lineno TSRMLS_CC);
- xdebug_llist_insert_next(XG(collected_errors), XDEBUG_LLIST_TAIL(XG(collected_errors)), printable_stack);
- }
         }
 
         /* Start JIT if requested and not yet enabled */
@@ -2594,7 +2568,7 @@
         op_array = old_compile_file(file_handle, type TSRMLS_CC);
 
         if (op_array) {
- if (XG(do_code_coverage) && XG(code_coverage_unused && op_array->done_pass_two)) {
+ if (XG(do_code_coverage) && XG(code_coverage_unused)) {
                         xdebug_prefill_code_coverage(op_array TSRMLS_CC);
                 }
         }
@@ -2602,15 +2576,6 @@
 }
 /* }}} */
 
-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 XG_SAPI_HEADER_OP_CC, s TSRMLS_CC);
- }
- return SAPI_HEADER_ADD;
-}
-
 /* {{{ proto integet xdebug_get_stack_depth()
    Returns the stack depth */
 PHP_FUNCTION(xdebug_get_stack_depth)
@@ -2691,41 +2656,14 @@
         add_next_index_string(return_value, name, 1);
 }
 
-/* {{{ proto array xdebug_print_function_stack([string message])
+/* {{{ proto array xdebug_print_declared_vars()
    Displays a stack trace */
 PHP_FUNCTION(xdebug_print_function_stack)
 {
- char *message = NULL;
- int message_len;
         function_stack_entry *i;
- char *tmp;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &message, &message_len) == FAILURE) {
- return;
- }
-
- i = xdebug_get_stack_frame(0 TSRMLS_CC);
- if (message) {
- tmp = get_printable_stack(PG(html_errors), "Xdebug", message, i->filename, i->lineno TSRMLS_CC);
- } else {
- tmp = get_printable_stack(PG(html_errors), "Xdebug", "user triggered", i->filename, i->lineno TSRMLS_CC);
- }
- php_printf("%s", tmp);
- xdfree(tmp);
-}
-/* }}} */
-
-/* {{{ proto array xdebug_get_formatted_function_stack()
- Displays a stack trace */
-PHP_FUNCTION(xdebug_get_formatted_function_stack)
-{
- function_stack_entry *i;
- char *tmp;
 
         i = xdebug_get_stack_frame(0 TSRMLS_CC);
- tmp = get_printable_stack(PG(html_errors), "Xdebug", "user triggered", i->filename, i->lineno TSRMLS_CC);
- RETVAL_STRING(tmp, 1);
- xdfree(tmp);
+ print_stack(PG(html_errors), "Xdebug", "user triggered", i->filename, i->lineno TSRMLS_CC);
 }
 /* }}} */
 
@@ -2934,7 +2872,7 @@
                         if (debugzval) {
                                 printf("%s: ", Z_STRVAL_PP(args[i]));
                                 val = xdebug_get_zval_value(debugzval, 1, NULL);
- printf("%s(%zd)", val, strlen(val));
+ printf("%s(%d)", val, strlen(val));
                                 xdfree(val);
                                 printf("\n");
                         }
@@ -2948,13 +2886,23 @@
 PHP_FUNCTION(xdebug_enable)
 {
         zend_error_cb = new_error_cb;
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
         zend_throw_exception_hook = xdebug_throw_exception_hook;
+#endif
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 0)
+ zend_opcode_handlers[ZEND_EXIT] = xdebug_exit_handler;
+#endif
 }
 
 PHP_FUNCTION(xdebug_disable)
 {
         zend_error_cb = old_error_cb;
+#ifdef ZEND_ENGINE_2
+# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 0)
+ zend_opcode_handlers[ZEND_EXIT] = old_exit_handler;
+# endif
         zend_throw_exception_hook = NULL;
+#endif
 }
 
 PHP_FUNCTION(xdebug_is_enabled)
@@ -2980,57 +2928,6 @@
         }
 }
 
-PHP_FUNCTION(xdebug_start_error_collection)
-{
- if (XG(do_collect_errors) == 1) {
- php_error(E_NOTICE, "Error collection was already started");
- }
- XG(do_collect_errors) = 1;
-}
-
-PHP_FUNCTION(xdebug_stop_error_collection)
-{
- if (XG(do_collect_errors) == 0) {
- php_error(E_NOTICE, "Error collection was not started");
- }
- XG(do_collect_errors) = 0;
-}
-
-PHP_FUNCTION(xdebug_get_collected_errors)
-{
- xdebug_llist_element *le;
- char *string;
- zend_bool clear = 0;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &clear) == FAILURE) {
- return;
- }
-
- array_init(return_value);
- for (le = XDEBUG_LLIST_HEAD(XG(collected_errors)); le != NULL; le = XDEBUG_LLIST_NEXT(le)) {
- string = XDEBUG_LLIST_VALP(le);
- add_next_index_string(return_value, string, 1);
- }
-
- if (clear) {
- xdebug_llist_destroy(XG(collected_errors), NULL);
- XG(collected_errors) = xdebug_llist_alloc(xdebug_collected_error_dtor);
- }
-}
-
-PHP_FUNCTION(xdebug_get_headers)
-{
- xdebug_llist_element *le;
- char *string;
-
- array_init(return_value);
- for (le = XDEBUG_LLIST_HEAD(XG(headers)); le != NULL; le = XDEBUG_LLIST_NEXT(le)) {
- string = XDEBUG_LLIST_VALP(le);
- add_next_index_string(return_value, string, 1);
- }
- xdebug_llist_empty(XG(headers), NULL);
-}
-
 PHP_FUNCTION(xdebug_start_trace)
 {
         char *fname = NULL;
@@ -3092,7 +2989,6 @@
         if (XG(trace_file)) {
                 if (XG(trace_format) == 1) {
                         fprintf(XG(trace_file), "Version: %s\n", XDEBUG_VERSION);
- fprintf(XG(trace_file), "File format: 2\n");
                 }
                 if (XG(trace_format) == 0 || XG(trace_format) == 1) {
                         str_time = xdebug_get_time();
@@ -3125,7 +3021,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 ? "%10zu" : "%lu", XG_MEMORY_USAGE());
+ fprintf(XG(trace_file), XG(trace_format) == 0 ? "%10u" : "%lu", XG_MEMORY_USAGE());
 #else
                         fprintf(XG(trace_file), XG(trace_format) == 0 ? "%10u" : "", 0);
 #endif
@@ -3236,26 +3132,35 @@
 
                 case IS_TMP_VAR:
                         *is_var = 1;
+#ifdef ZEND_ENGINE_2
                         return &T(node->u.var).tmp_var;
+#else
+ return &Ts[node->u.var].tmp_var;
+#endif
                         break;
 
                 case IS_VAR:
                         *is_var = 1;
+#ifdef ZEND_ENGINE_2
                         if (T(node->u.var).var.ptr) {
                                 return T(node->u.var).var.ptr;
                         } else {
                                 fprintf(stderr, "\nIS_VAR\n");
                         }
+#else
+ if (Ts[node->u.var].var.ptr) {
+ return Ts[node->u.var].var.ptr;
+ } else {
+ fprintf(stderr, "\nIS_VAR\n");
+ }
+#endif
                         break;
 
- case IS_CV: {
- zval **tmp;
- tmp = zend_get_compiled_variable_value(zdata, node->u.constant.value.lval);
- if (tmp) {
- return *tmp;
- }
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || (PHP_MAJOR_VERSION >= 6)
+ case IS_CV:
+ return *zend_get_compiled_variable_value(zdata, node->u.constant.value.lval);
                         break;
- }
+#endif
 
                 case IS_UNUSED:
                         fprintf(stderr, "\nIS_UNUSED\n");
@@ -3289,7 +3194,7 @@
         file_len = strlen(file);
 
         if (XG(do_code_coverage)) {
- xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC);
+ /*xdebug_count_instruction(EG(current_execute_data)->opline, TSRMLS_CC);*/
         }
 
         if (XG(remote_enabled)) {
@@ -3424,7 +3329,7 @@
         XDEBUG_VERSION,
         XDEBUG_AUTHOR,
         XDEBUG_URL,
- XDEBUG_COPYRIGHT_SHORT,
+ "Copyright (c) 2002-2008",
         xdebug_zend_startup,
         xdebug_zend_shutdown,
         NULL, /* activate_func_t */

[FILE: /xdebug/xdebug_code_coverage.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.53
retrieving revision 1.53.2.1
diff -u -r1.53 -r1.53.2.1
--- xdebug/xdebug_code_coverage.c:1.53 Sat Jul 04 12:31:44 2009 GMT
+++ xdebug/xdebug_code_coverage.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -22,80 +22,295 @@
 #include "xdebug_var.h"
 #include "xdebug_code_coverage.h"
 #include "xdebug_compat.h"
+#include "srm_oparray.h"
 
 extern ZEND_DECLARE_MODULE_GLOBALS(xdebug);
+extern const op_usage opcodes[];
+
+void xdebug_coverage_decision_dtor(void *data)
+{
+ xdebug_coverage_decision *decision = (xdebug_coverage_decision *) data;
+ xdfree(decision);
+}
+
+void xdebug_coverage_instruction_dtor(void *data)
+{
+ xdebug_coverage_instruction *instruction = (xdebug_coverage_instruction *) data;
+ xdfree(instruction->opcode_name);
+ /*
+ if (instruction->decision) {
+ xdebug_set_free(instruction->decision_branch1_set);
+ xdebug_set_free(instruction->decision_branch2_set);
+ }
+ */
+ xdfree(instruction);
+}
 
 void xdebug_coverage_line_dtor(void *data)
 {
         xdebug_coverage_line *line = (xdebug_coverage_line *) data;
-
+ xdebug_hash_destroy(line->instructions);
+ /*
+ if (line->decision) {
+ xdebug_set_free(line->decision_branch1_set);
+ xdebug_set_free(line->decision_branch2_set);
+ }
+ */
         xdfree(line);
 }
 
+void xdebug_coverage_function_dtor(void *data) {
+ xdebug_coverage_function *function = (xdebug_coverage_function *) data;
+ xdebug_hash_destroy(function->lines);
+
+ xdebug_hash_destroy(function->decisions);
+ xdebug_set_free(function->total_branches_set);
+ xdebug_set_free(function->branches_counted_set);
+}
+
 void xdebug_coverage_file_dtor(void *data)
 {
         xdebug_coverage_file *file = (xdebug_coverage_file *) data;
-
- xdebug_hash_destroy(file->lines);
+ xdebug_hash_destroy(file->functions);
         xdfree(file->name);
         xdfree(file);
 }
 
-void xdebug_count_line(char *filename, int lineno, int executable, int deadcode TSRMLS_DC)
-{
- xdebug_coverage_file *file;
- xdebug_coverage_line *line;
- char *sline;
-
- sline = xdebug_sprintf("%d", lineno);
+static void prefill_from_opcode(char *filename, zend_op_array *op_array, zend_op op, unsigned int position, unsigned int *instructions_prefilled, int deadcode TSRMLS_DC)
+{
+ xdebug_coverage_file *file;
+ xdebug_coverage_function *function;
+ xdebug_coverage_line *line;
+ xdebug_coverage_instruction *instruction;
+ xdebug_coverage_decision *decision;
+ zend_op previous_op;
+ int position_in_line;
+ unsigned int jmp_position1 = 0, jmp_position2 = 0;
+ char *function_name;
+ char *sline = xdebug_sprintf("%d", op.lineno);
+ char *sposition = xdebug_sprintf("%d", position), *sposition_in_line;
+ zend_op *base_address = &(op_array->opcodes[0]);
+ int num_known_opcodes = sizeof(op_array) / sizeof(op_array[0]);
+ /*fprintf(stderr, "XDEBUG_CC: prefill_from_opcode: starting...sline = %s sposition = %s filename = %s \n", sline, xdebug_sprintf("%d", position), filename);*/
+
+ if (op_array->type == ZEND_USER_FUNCTION) {
+ if (op_array->function_name == NULL)
+ function_name = "0" ;
+ else
+ function_name = op_array->function_name ;
+ /*fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode: setting function name to %s...\n", function_name);*/
+ } else return; //don'tcount classes as yet
+
+ /* Check if the file already exists in the hash */
+ if (!xdebug_hash_find(XG(code_coverage), filename, strlen(filename), (void *) &file)) {
+ /* The file does not exist, so we add it to the hash, and add a functions element to the file */
+ file = xdmalloc(sizeof(xdebug_coverage_file));
+ file->name = xdstrdup(filename);
+ file->functions = xdebug_hash_alloc(128, xdebug_coverage_function_dtor);
+ file->total_branches = 0;
+ file->branches_counted = 0;
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode: adding file with filename=%s to hash...\n", filename);
+ xdebug_hash_add(XG(code_coverage), filename, strlen(filename), file);
+ }
+
+ /* Check if the function already exists in the hash */
+ if (!xdebug_hash_find(file->functions, function_name, strlen(function_name), (void *) &function)) {
+ *instructions_prefilled = 0;
+ function = xdmalloc(sizeof(xdebug_coverage_function));
+ function->name = xdstrdup(function_name);
+ function->dead = 0;
+ function->count = 0;
+ function->executed = 0;
+ function->lines = xdebug_hash_alloc(128, xdebug_coverage_line_dtor);
+ function->total_lines = 0;
+ function->lines_counted = 0;
+ function->decisions = xdebug_hash_alloc(128, xdebug_coverage_decision_dtor);
+ function->total_branches_set = xdebug_set_create(op_array->last);
+ function->total_branches = 0;
+ function->branches_counted = 0;
+ function->branches_counted_set = xdebug_set_create(op_array->last);
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode: adding function with name=%s to hash...\n", function->name);
+ xdebug_hash_add(file->functions, function_name, strlen(function_name), function);
+ }
+
+ /* Check if the line already exists in the hash */
+ if (!xdebug_hash_find(function->lines, sline, strlen(sline), (void *) &line)) {
+ *instructions_prefilled = position;
+ line = xdmalloc(sizeof(xdebug_coverage_line));
+ line->count = 0;
+ line->executed = 0;
+ line->lineno = 0;
+ line->dead = 0;
+ line->instructions_counted = 0;
+ line->total_instructions = 0;
+ line->previous_total_instructions = *instructions_prefilled;
+ line->instructions = xdebug_hash_alloc(16, xdebug_coverage_instruction_dtor); /* can be less if max instructions per line < 8*/
+ line->decision = 0;
+ line->decision_branch1_lineno = 0;
+ line->decision_branch2_lineno = 0;
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode adding line with lineno=%s and instructions_prefilled=%d to hash...\n", sline, *instructions_prefilled);
+ xdebug_hash_add(function->lines, sline, strlen(sline), line);
+ }
+ position_in_line = position - *instructions_prefilled;
+ sposition_in_line = xdebug_sprintf("%d", position_in_line);
+
+ /* Check if the instruction already exists in the hash */
+ if (xdebug_hash_find(line->instructions, sposition_in_line, strlen(sposition_in_line), (void *) &instruction)) {
+ /*bailout: error*/
+ php_error(E_USER_ERROR, "XDEBUG_CC: prefill_from_opcode: instruction already exists in line hash.");
+ return;
+ }
+ /*Add the instruction to the line*/
+ instruction = xdmalloc(sizeof(xdebug_coverage_instruction));
+ if (op.opcode < 150)
+ instruction->opcode_name = xdstrdup(opcodes[op.opcode].name);
+ else instruction->opcode_name = xdstrdup("UNKNOWN");
+ instruction->op = op;
+ instruction->position = position_in_line;
+ instruction->count = 0;
+ instruction->dead = deadcode;
+ instruction->executed = 0;
+ instruction->lineno = op.lineno;
+ instruction->decision = 0;
+ instruction->decision_branch1_position = 0;
+ instruction->decision_branch2_position = 0;
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode adding instruction with position=%s dead=%d lineno=%s instructions_prefilled=%d position_in_line=%d to line hash...\n", sposition,instruction->dead, sline, *instructions_prefilled, position_in_line);
+ xdebug_hash_add(line->instructions, sposition_in_line, strlen(sposition_in_line), instruction);
+ if (line->lineno == 0) line->lineno = instruction->lineno;
+ line->total_instructions++;
+ xdfree(sposition_in_line);
+
+ /*check if this is a decision*/
+ if (
+ op.opcode == ZEND_JMPZ ||
+ op.opcode == ZEND_JMPNZ ||
+ op.opcode == ZEND_JMPZ_EX ||
+ op.opcode == ZEND_JMPNZ_EX ||
+ op.opcode == ZEND_JMPZNZ)
+ {
+ previous_op = op_array->opcodes[position - 1];
+ if (previous_op.opcode == ZEND_EXT_STMT) previous_op = op_array->opcodes[position - 2];
+ if (
+ previous_op.opcode == ZEND_IS_SMALLER ||
+ previous_op.opcode == ZEND_IS_IDENTICAL ||
+ previous_op.opcode == ZEND_IS_NOT_IDENTICAL ||
+ previous_op.opcode == ZEND_IS_EQUAL ||
+ previous_op.opcode == ZEND_IS_NOT_EQUAL ||
+ previous_op.opcode == ZEND_IS_SMALLER)
+ {
+ if (op.opcode == ZEND_JMPZ || op.opcode == ZEND_JMPNZ || op.opcode == ZEND_JMPZ_EX || op.opcode == ZEND_JMPNZ_EX)
+ {
+ jmp_position1 = position + 1;
+ #ifdef ZEND_ENGINE_2
+ jmp_position2 = ((long) op.op2.u.jmp_addr - (long) base_address) / sizeof(zend_op);
+ #else
+ jmp_position2 = op.op1.u.opline_num;
+ #endif
+ }
+ else/*ZEND_JMPZNZ*/
+ {
+ jmp_position1 = op.op2.u.opline_num;
+ jmp_position2 = op.extended_value;
+ }
+ }
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode: Found decision with position=%s jmp1=%d jmp2=%d.\n", sposition, jmp_position1, jmp_position2);
+ /*Create a decision andd add it to the function*/
+ decision = xdmalloc(sizeof(xdebug_coverage_decision));
+ decision->instruction_position = position;
+ decision->lineno = op.lineno;
+ decision->branch1_position = jmp_position1;
+ decision->branch1_lineno = op_array->opcodes[jmp_position1].lineno;
+ decision->branch1_set = xdebug_set_create(op_array->last);
+ decision->branch2_position = jmp_position2;
+ decision->branch2_lineno = op_array->opcodes[jmp_position2].lineno;
+ decision->branch2_set = xdebug_set_create(op_array->last);
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_opcode adding decision with position=%d branch1_position=%d branch2_position=%d to hash...\n", position, jmp_position1, jmp_position2);
+ xdebug_hash_add(function->decisions, sposition, strlen(sposition), decision);
+ xdebug_set_add(function->total_branches_set, jmp_position1);
+ xdebug_set_add(function->total_branches_set, jmp_position2);
+ function->total_branches += 2;
+ file->total_branches += 2;
+ /*Also add the decision to the instruction and the line in the file*/
+ instruction->decision = 1;
+ instruction->decision_branch1_position = jmp_position1;
+ instruction->decision_branch2_position = jmp_position2;
+ line->decision = 1;
+ line->decision_branch1_lineno = decision->branch1_lineno;
+ line->decision_branch2_lineno = decision->branch2_lineno;
+ }
 
- /* Check if the file already exists in the hash */
- if (!xdebug_hash_find(XG(code_coverage), filename, strlen(filename), (void *) &file)) {
- /* The file does not exist, so we add it to the hash, and
- * add a line element to the file */
- file = xdmalloc(sizeof(xdebug_coverage_file));
- file->name = xdstrdup(filename);
- file->lines = xdebug_hash_alloc(128, xdebug_coverage_line_dtor);
-
- xdebug_hash_add(XG(code_coverage), filename, strlen(filename), file);
- }
-
- /* Check if the line already exists in the hash */
- if (!xdebug_hash_find(file->lines, sline, strlen(sline), (void *) &line)) {
- line = xdmalloc(sizeof(xdebug_coverage_line));
- line->lineno = lineno;
- line->count = 0;
- line->executable = 0;
-
- xdebug_hash_add(file->lines, sline, strlen(sline), line);
- }
-
- if (executable) {
- if (line->executable != 1 && deadcode) {
- line->executable = 2;
- } else {
- line->executable = 1;
- }
- } else {
- line->count++;
- }
-
- xdfree(sline);
+ xdfree(sline);
+ xdfree(sposition);
 }
 
-static void prefill_from_opcode(char *fn, zend_op opcode, int deadcode TSRMLS_DC)
+void xdebug_count_instruction(zend_op *op, zend_execute_data *execute_data TSRMLS_DC)
 {
- if (
- opcode.opcode != ZEND_NOP &&
- opcode.opcode != ZEND_EXT_NOP &&
- opcode.opcode != ZEND_RECV &&
- opcode.opcode != ZEND_RECV_INIT
- && opcode.opcode != ZEND_VERIFY_ABSTRACT_CLASS
- && opcode.opcode != ZEND_OP_DATA
- && opcode.opcode != ZEND_ADD_INTERFACE
- ) {
- xdebug_count_line(fn, opcode.lineno, 1, deadcode TSRMLS_CC);
- }
+ xdebug_coverage_file *file;
+ xdebug_coverage_function *function;
+ xdebug_coverage_line *line;
+ xdebug_coverage_instruction *instruction;
+ zend_op_array *op_array = execute_data->op_array;
+ zend_op *base_address = &(op_array->opcodes[0]);
+ int position = (((long) op) - (long) base_address) / sizeof(zend_op), position_in_line;
+ int executed;
+ char *sline = xdebug_sprintf("%d", op->lineno);
+ char *sposition = xdebug_sprintf("%d", position), *sposition_in_line;
+ char *filename = op_array->filename;
+ char *function_name;
+ fprintf(stderr, "XDEBUG_CC: xdebug_count_instruction: starting...sline = %s sposition = %s filename = %s \n", sline, sposition, filename);
+ if (op_array->type == ZEND_USER_FUNCTION) {
+ if (op_array->function_name == NULL)
+ function_name = "0" ;
+ else
+ function_name = op_array->function_name ;
+ fprintf(stderr, "XDEBUG_CC: xdebug_count_instruction: setting function name to %s...\n", function_name);
+ }
+ /*fprintf(stderr, "XDEBUG_CC: xdebug_count_instruction: starting...sline = %s sposition = %s filename = %s \n", sline, sposition, filename);*/
+ if (!xdebug_hash_find(XG(code_coverage), filename, strlen(filename), (void *) &file)) {
+ /*bailout: error*/
+ php_error(E_USER_ERROR, "XDEBUG_CC: xdebug_count_instruction: file does not exist in hash.");
+ return;
+ }
+ /* Check if the function exists in the hash */
+ if (!xdebug_hash_find(file->functions, function_name, strlen(function_name), (void *) &function)) {
+ /*bailout: error*/
+ php_error(E_USER_ERROR, "XDEBUG_CC: xdebug_count_instruction: function does not exist in hash.");
+ return;
+ }
+ /* Check if the line exists in the hash */
+ if (!xdebug_hash_find(function->lines, sline, strlen(sline), (void *) &line)) {
+ /*bailout: error*/
+ php_error(E_USER_ERROR, "XDEBUG_CC: xdebug_count_instruction: line does not exist in hash.");
+ return;
+ }
+ position_in_line = position - line->previous_total_instructions;
+ sposition_in_line = xdebug_sprintf("%d", position_in_line);
+ /* Check if the instruction already exists in the hash */
+ if (!xdebug_hash_find(line->instructions, sposition_in_line, strlen(sposition_in_line), (void *) &instruction)) {
+ /*bailout: error*/
+ php_error(E_USER_ERROR, xdebug_sprintf("XDEBUG_CC: xdebug_count_instruction: instruction at position %s, position_in_line %s does not exist in hash."), position, position_in_line);
+ return;
+ }
+ fprintf(stderr, "XDEBUG_CC: xdebug_count_instruction: counting instruction at position %s, position_in_line %s, in line %s.\n", sposition, sposition_in_line, sline);
+ executed = instruction->executed;
+ instruction->count++;
+ if (instruction->executed == 0) instruction->executed = 1;
+ //instruction->execute_data = execute_data;
+ if (line->executed == 0) line->executed = 1;
+ if (instruction->position == (line->total_instructions - 1)) line->count++; /*only count the line once when the final instruction executes*/
+
+ if (xdebug_set_in(function->total_branches_set, position)) { /*Instruction is in a decision branch*/
+ if (!xdebug_set_in(function->branches_counted_set, position)) /*Only increment branches_counted first time counting instructions*/
+ {
+ function->branches_counted++;
+ file->branches_counted++;
+ xdebug_set_add(function->branches_counted_set, position);
+ }
+ }
+ xdfree(sline);
+ xdfree(sposition);
+ xdfree(sposition_in_line);
+
 }
 
 static zend_brk_cont_element* xdebug_find_brk_cont(zval *nest_levels_zval, int array_offset, zend_op_array *op_array)
@@ -145,7 +360,11 @@
                 zend_brk_cont_element *el;
 
                 if (opcode.op2.op_type == IS_CONST
+#ifdef ZEND_ENGINE_2
                     && opcode.op1.u.jmp_addr != (zend_op*) 0xFFFFFFFF
+#else
+ && opcode.op1.u.opline_num > -1
+#endif
                 ) {
                         el = xdebug_find_brk_cont(&opcode.op2.u.constant, opcode.op1.u.opline_num, opa);
                         *jmp1 = opcode.opcode == ZEND_BRK ? el->brk : el->cont;
@@ -161,8 +380,8 @@
 
 static void xdebug_analyse_branch(zend_op_array *opa, unsigned int position, xdebug_set *set)
 {
- long jump_pos1;
- long jump_pos2;
+ long jump_pos1 = -1;
+ long jump_pos2 = -1;
 
         /*(fprintf(stderr, "Branch analysis from position: %d\n", position);)*/
         /* First we see if the branch has been visited, if so we bail out. */
@@ -173,16 +392,14 @@
         xdebug_set_add(set, position);
         /*(fprintf(stderr, "XDEBUG Adding %d\n", position);)*/
         while (position < opa->last) {
- jump_pos1 = -1;
- jump_pos2 = -1;
 
                 /* See if we have a jump instruction */
                 if (xdebug_find_jump(opa, position, &jump_pos1, &jump_pos2)) {
                         /*(fprintf(stderr, "XDEBUG Jump found. Position 1 = %d", jump_pos1);)*/
                         if (jump_pos2 != -1) {
- /*(fprintf(stderr, ", Position 2 = %d\n", jump_pos2))*/;
+ /*(fprintf(stderr, ", Position 2 = %d\n", jump_pos2);)*/
                         } else {
- /*(fprintf(stderr, "\n"))*/;
+ /*(fprintf(stderr, "\n");)*/
                         }
                         xdebug_analyse_branch(opa, jump_pos1, set);
                         if (jump_pos2 != -1 && jump_pos2 <= opa->last) {
@@ -190,7 +407,7 @@
                         }
                         break;
                 }
-
+#ifdef ZEND_ENGINE_2
                 /* See if we have a throw instruction */
                 if (opa->opcodes[position].opcode == ZEND_THROW) {
                         /* fprintf(stderr, "Throw found at %d\n", position); */
@@ -207,7 +424,7 @@
                         }
                         position--;
                 }
-
+#endif
                 /* See if we have an exit instruction */
                 if (opa->opcodes[position].opcode == ZEND_EXIT) {
                         /* fprintf(stderr, "X* Return found\n"); */
@@ -227,11 +444,15 @@
 
 static void prefill_from_oparray(char *fn, zend_op_array *opa TSRMLS_DC)
 {
- unsigned int i;
+ char cache_key[256];
+ int cache_key_len;
+ void *dummy;
+ unsigned int i, j = 0;
         xdebug_set *set = NULL;
-
+ fprintf(stderr, "XDEBUG_CC: prefill_from_oparray: starting...\n");
         opa->reserved[XG(reserved_offset)] = (void*) 1;
 
+#ifdef ZEND_ENGINE_2
         /* Check for abstract methods and simply return from this function in those
          * cases. */
 #if PHP_VERSION_ID >= 50300
@@ -242,8 +463,10 @@
         {
                 return;
         }
+#endif
 
         /* Run dead code analysis if requested */
+
         if (XG(code_coverage_dead_code_analysis) && opa->done_pass_two) {
                 set = xdebug_set_create(opa->last);
                 xdebug_analyse_branch(opa, 0, set);
@@ -252,7 +475,8 @@
         /* The normal loop then finally */
         for (i = 0; i < opa->last; i++) {
                 zend_op opcode = opa->opcodes[i];
- prefill_from_opcode(fn, opcode, set ? !xdebug_set_in(set, i) : 0 TSRMLS_CC);
+ fprintf(stderr, "XDEBUG_CC: prefill_from_oparray: calling prefill_from_opcode for opcode %d.\n", i);
+ prefill_from_opcode(fn, opa, opcode, i, &j, set ? !xdebug_set_in(set, i) : 0 TSRMLS_CC);
         }
 
         if (set) {
@@ -277,19 +501,31 @@
         return ZEND_HASH_APPLY_KEEP;
 }
 
+#ifdef ZEND_ENGINE_2
 static int prefill_from_class_table(zend_class_entry **class_entry XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+#else
+static int prefill_from_class_table(zend_class_entry *class_entry XDEBUG_ZEND_HASH_APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
+#endif
 {
         char *new_filename;
         zend_class_entry *ce;
 
+#ifdef ZEND_ENGINE_2
         ce = *class_entry;
+#else
+ ce = class_entry;
+#endif
 
         new_filename = va_arg(args, char*);
         if (ce->type == ZEND_USER_CLASS) {
+#if PHP_MAJOR_VERSION >= 5
                 if (!(ce->ce_flags & ZEND_XDEBUG_VISITED)) {
                         ce->ce_flags |= ZEND_XDEBUG_VISITED;
                         zend_hash_apply_with_arguments(&ce->function_table XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) prefill_from_function_table, 1, new_filename);
                 }
+#else
+ zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) prefill_from_function_table, 1, new_filename);
+#endif
         }
 
         return ZEND_HASH_APPLY_KEEP;
@@ -297,7 +533,8 @@
 
 void xdebug_prefill_code_coverage(zend_op_array *op_array TSRMLS_DC)
 {
- if (op_array->reserved[XG(reserved_offset)] != (void*) 1) {
+ fprintf(stderr, "XDEBUG_CC: xdebug_prefill_code_coverage starting...\n");
+ if (op_array->reserved[XG(reserved_offset)] != (void*) 1) {
                 prefill_from_oparray(op_array->filename, op_array TSRMLS_CC);
         }
 
@@ -316,11 +553,9 @@
         XG(code_coverage_dead_code_analysis) = (options & XDEBUG_CC_OPTION_DEAD_CODE);
 
         if (XG(extended_info)) {
- RETVAL_BOOL(!XG(do_code_coverage));
                 XG(do_code_coverage) = 1;
         } else {
                 php_error(E_WARNING, "You can only use code coverage when you leave the setting of 'xdebug.extended_info' to the default '1'.");
- RETVAL_BOOL(0);
         }
 }
 
@@ -337,9 +572,7 @@
                         XG(code_coverage) = xdebug_hash_alloc(32, xdebug_coverage_file_dtor);
                 }
                 XG(do_code_coverage) = 0;
- RETURN_TRUE;
         }
- RETURN_FALSE;
 }
 
 
@@ -357,38 +590,91 @@
         }
 }
 
+static void add_instruction(void *ret, xdebug_hash_element *e) {
+ xdebug_coverage_instruction *instruction = (xdebug_coverage_instruction*) e->ptr;
+ zval *retval = (zval*) ret;
+ zval *instruction_zval;
+
+ TSRMLS_FETCH();
+ MAKE_STD_ZVAL(instruction_zval);
+ array_init(instruction_zval);
+
+ add_assoc_long(instruction_zval, "position", instruction->position);
+ add_assoc_long(instruction_zval, "count", instruction->count);
+ add_assoc_string(instruction_zval, "opcode name", instruction->opcode_name, 1);
+ add_assoc_long(instruction_zval, "dead", instruction->dead);
+ add_assoc_long(instruction_zval, "executed", instruction->executed);
+ add_index_zval(retval, instruction->position, instruction_zval);
+}
 
 static void add_line(void *ret, xdebug_hash_element *e)
 {
         xdebug_coverage_line *line = (xdebug_coverage_line*) e->ptr;
         zval *retval = (zval*) ret;
-
- if (line->executable && (line->count == 0)) {
- add_index_long(retval, line->lineno, -line->executable);
- } else {
- add_index_long(retval, line->lineno, 1);
- }
+ zval *instructions;
+ zval *line_zval;
+ HashTable *target_hash;
+
+ TSRMLS_FETCH();
+ MAKE_STD_ZVAL(line_zval);
+ MAKE_STD_ZVAL(instructions);
+ array_init(line_zval);
+ array_init(instructions);
+
+ xdebug_hash_apply(line->instructions, (void *) instructions, add_instruction);
+ /* Sort instructions on position */
+ target_hash = HASH_OF(instructions);
+ zend_hash_sort(target_hash, zend_qsort, xdebug_lineno_cmp, 0 TSRMLS_CC);
+ add_assoc_long(line_zval, "lineno", line->lineno);
+ add_assoc_long(line_zval, "count", line->count);
+ add_assoc_long(line_zval, "executed", line->executed);
+
+
+ add_assoc_zval(line_zval, "instructions", instructions);
+ add_index_zval(retval, line->lineno, line_zval);
+}
+
+static void add_cc_function(void *ret, xdebug_hash_element *e)
+{
+ xdebug_coverage_function *function = (xdebug_coverage_function*) e->ptr;
+ zval *retval = (zval*) ret;
+ zval *lines;
+ zval *function_zval;
+ TSRMLS_FETCH();
+ HashTable *target_hash;
+
+ MAKE_STD_ZVAL(lines);
+ array_init(lines);
+ MAKE_STD_ZVAL(function_zval);
+ array_init(function_zval);
+
+
+ xdebug_hash_apply(function->lines, (void *) lines, add_line);
+
+ /* Sort on linenumber */
+ target_hash = HASH_OF(lines);
+ zend_hash_sort(target_hash, zend_qsort, xdebug_lineno_cmp, 0 TSRMLS_CC);
+
+ /* Add all the lines */
+ add_assoc_zval_ex(function_zval, "lines", strlen("lines") + 1, lines);
+ add_assoc_long(function_zval, "total_branches", function->total_branches);
+ add_assoc_long(function_zval, "branches_counted", function->branches_counted);
+ add_assoc_zval_ex(retval, function->name, strlen(function->name) + 1, function_zval);
 }
 
 static void add_file(void *ret, xdebug_hash_element *e)
 {
- xdebug_coverage_file *file = (xdebug_coverage_file*) e->ptr;
- zval *retval = (zval*) ret;
- zval *lines;
- HashTable *target_hash;
- TSRMLS_FETCH();
-
- MAKE_STD_ZVAL(lines);
- array_init(lines);
-
- /* Add all the lines */
- xdebug_hash_apply(file->lines, (void *) lines, add_line);
-
- /* Sort on linenumber */
- target_hash = HASH_OF(lines);
- zend_hash_sort(target_hash, zend_qsort, xdebug_lineno_cmp, 0 TSRMLS_CC);
-
- add_assoc_zval_ex(retval, file->name, strlen(file->name) + 1, lines);
+ xdebug_coverage_file *file = (xdebug_coverage_file*) e->ptr;
+ zval *retval = (zval*) ret;
+ zval *functions;
+ TSRMLS_FETCH();
+
+ MAKE_STD_ZVAL(functions);
+ array_init(functions);
+
+ /* Add all the functions */
+ xdebug_hash_apply(file->functions, (void *) functions, add_cc_function);
+ add_assoc_zval_ex(retval, file->name, strlen(file->name) + 1, functions);
 }
 
 PHP_FUNCTION(xdebug_get_code_coverage)

[FILE: /xdebug/xdebug_code_coverage.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- xdebug/xdebug_code_coverage.h:1.13 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_code_coverage.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -22,23 +22,89 @@
 #include "php.h"
 #include "xdebug_hash.h"
 #include "xdebug_mm.h"
+#include "xdebug_set.h"
+#include "srm_oparray.h"
+
+
+typedef struct xdebug_coverage_decision {
+ int lineno;
+ int instruction_position;
+ int executed;
+ int branch1_lineno;
+ int branch1_position;
+ int branch1_executed;
+ xdebug_set *branch1_set;
+ int branch2_lineno;
+ int branch2_position;
+ int branch2_executed;
+ xdebug_set *branch2_set;
+} xdebug_coverage_decision;
+
+typedef struct xdebug_coverage_instruction {
+ zend_op op;
+ int position;
+ char *opcode_name;
+ zend_execute_data* execute_data;
+ int executed;
+ int lineno;
+ int dead;
+ int count;
+ int decision;
+ int decision_branch1_position;
+ int decision_branch2_position;
+ int decision_branch1_set;
+ int decision_branch2_set;
+} xdebug_coverage_instruction;
 
 typedef struct xdebug_coverage_line {
- int lineno;
+ int dead;
         int count;
- int executable;
+ int executed;
+ int lineno;
+ int decision;
+ int decision_branch1_lineno;
+ int decision_branch2_lineno;
+ int decision_branch1_set;
+ int decision_branch2_set;
+ int previous_total_instructions;
+ int total_instructions;
+ int instructions_counted;
+ xdebug_hash *instructions;
 } xdebug_coverage_line;
 
+typedef struct xdebug_coverage_function {
+ char *name;
+ int dead;
+ int count;
+ int executed;
+ xdebug_hash *lines;
+ int total_lines;
+ int lines_counted;
+ xdebug_hash *decisions;
+ int total_branches;
+ xdebug_set *total_branches_set;
+ int branches_counted;
+ xdebug_set *branches_counted_set;
+} xdebug_coverage_function;
+
 typedef struct xdebug_coverage_file {
- char *name;
- xdebug_hash *lines;
+ char *name;
+ xdebug_hash *functions;
+ int total_lines;
+ int lines_counted;
+ int total_branches;
+ int branches_counted;
 } xdebug_coverage_file;
 
 void xdebug_coverage_line_dtor(void *data);
+void xdebug_coverage_instruction_dtor(void *data);
+void xdebug_coverage_decision_dtor(void *data);
 void xdebug_coverage_file_dtor(void *data);
 
-void xdebug_count_line(char *file, int lineno, int executable, int deadcode TSRMLS_DC);
+static void prefill_from_opcode(char *filename, zend_op_array *op_array, zend_op op, unsigned int position, unsigned int *instructions_prefilled, int deadcode TSRMLS_DC);
+void xdebug_count_instruction(zend_op *op, zend_execute_data *execute_data TSRMLS_DC);
 void xdebug_prefill_code_coverage(zend_op_array *op_array TSRMLS_DC);
+static void xdebug_analyse_branch(zend_op_array *opa, unsigned int position, xdebug_set *set);
 
 PHP_FUNCTION(xdebug_start_code_coverage);
 PHP_FUNCTION(xdebug_stop_code_coverage);

[FILE: /xdebug/xdebug_com.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -r1.15 -r1.15.2.1
--- xdebug/xdebug_com.c:1.15 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_com.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_com.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- xdebug/xdebug_com.h:1.13 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_com.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_compat.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- xdebug/xdebug_compat.c:1.13 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_compat.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans <derick[@]xdebug.org> |
+ | Copyright (c) 2002-2008 Derick Rethans <derick[@]xdebug.org> |
    | (c) 1997-2004 Jim Winstead <jimw[@]trainedmonkey.com> |
    | (c) 1998-2004 Andi Gutmans <andi[@]zend.com> and |
    | Zeev Suraski <zeev[@]zend.com> |
@@ -38,7 +38,7 @@
    | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
    +----------------------------------------------------------------------+
  */
-/* $Id: cvstemp,v 1.13 2009/05/07 20:39:13 derick Exp $ */
+/* $Id: cvstemp,v 1.13.2.1 2009/07/15 11:39:20 allisterb Exp $ */
 
 #include "php.h"
 #include "main/php_version.h"
@@ -46,12 +46,249 @@
 #include "zend_extensions.h"
 
 #if PHP_MAJOR_VERSION >= 6
+
 void xdebug_php_var_dump(zval **struc, int level TSRMLS_DC)
 {
         php_var_dump(struc, 1, 1 TSRMLS_CC);
 }
+
+#elif (PHP_MAJOR_VERSION == 4) && (PHP_MINOR_VERSION == 3) && (PHP_RELEASE_VERSION <= 1)
+
+#define COMMON ((*struc)->is_ref ? "&" : "")
+/* {{{ xdebug_var_dump */
+
+static int php_array_element_dump(zval **zv, int num_args, va_list args, zend_hash_key *hash_key)
+{
+ int level;
+ TSRMLS_FETCH();
+
+ level = va_arg(args, int);
+
+ if (hash_key->nKeyLength==0) { /* numeric key */
+ php_printf("%*c[%ld]=>\n", level + 1, ' ', hash_key->h);
+ } else { /* string key */
+ php_printf("%*c[\"", level + 1, ' ');
+ PHPWRITE(hash_key->arKey, hash_key->nKeyLength - 1);
+ php_printf("\"]=>\n");
+ }
+ xdebug_php_var_dump(zv, level + 2 TSRMLS_CC);
+ return 0;
+}
+
+void xdebug_php_var_dump(zval **struc, int level TSRMLS_DC)
+{
+ HashTable *myht = NULL;
+ zend_object *object = NULL;
+
+ if (level > 1) {
+ php_printf("%*c", level - 1, ' ');
+ }
+
+ switch (Z_TYPE_PP(struc)) {
+ case IS_BOOL:
+ php_printf("%sbool(%s)\n", COMMON, Z_LVAL_PP(struc)?"true":"false");
+ break;
+ case IS_NULL:
+ php_printf("%sNULL\n", COMMON);
+ break;
+ case IS_LONG:
+ php_printf("%sint(%ld)\n", COMMON, Z_LVAL_PP(struc));
+ break;
+ case IS_DOUBLE:
+ php_printf("%sfloat(%.*G)\n", COMMON, (int) EG(precision), Z_DVAL_PP(struc));
+ break;
+ case IS_STRING:
+ php_printf("%sstring(%d) \"", COMMON, Z_STRLEN_PP(struc));
+ PHPWRITE(Z_STRVAL_PP(struc), Z_STRLEN_PP(struc));
+ PUTS("\"\n");
+ break;
+ case IS_ARRAY:
+ myht = Z_ARRVAL_PP(struc);
+ if (myht->nApplyCount > 1) {
+ PUTS("*RECURSION*\n");
+ return;
+ }
+ php_printf("%sarray(%d) {\n", COMMON, zend_hash_num_elements(myht));
+ goto head_done;
+ case IS_OBJECT:
+ object = Z_OBJ_PP(struc);
+ myht = Z_OBJPROP_PP(struc);
+ if (myht->nApplyCount > 1) {
+ PUTS("*RECURSION*\n");
+ return;
+ }
+ php_printf("%sobject(%s)(%d) {\n", COMMON, Z_OBJCE_PP(struc)->name, zend_hash_num_elements(myht));
+head_done:
+ zend_hash_apply_with_arguments(myht, (apply_func_args_t) php_array_element_dump, 1, level);
+ if (level > 1) {
+ php_printf("%*c", level-1, ' ');
+ }
+ PUTS("}\n");
+ break;
+ case IS_RESOURCE: {
+ char *type_name;
+
+ type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(struc) TSRMLS_CC);
+ php_printf("%sresource(%ld) of type (%s)\n", COMMON, Z_LVAL_PP(struc), type_name ? type_name : "Unknown");
+ break;
+ }
+ default:
+ php_printf("%sUNKNOWN:0\n", COMMON);
+ break;
+ }
+}
+/* }}} */
+#endif
+
+
+#if (PHP_MAJOR_VERSION == 4) && (PHP_MINOR_VERSION == 3) && (PHP_RELEASE_VERSION <= 4)
+
+#include <string.h>
+
+/* {{{ */
+static const char base64_table[] =
+ { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0'
+ };
+
+static const char base64_pad = '=';
+
+static const short base64_reverse_table[256] = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
+ -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
+};
+/* }}} */
+
+/* {{{ */
+unsigned char *xdebug_base64_encode(const unsigned char *str, int length, int *ret_length)
+{
+ const unsigned char *current = str;
+ int i = 0;
+ unsigned char *result = (unsigned char *)emalloc(((length + 3 - length % 3) * 4 / 3 + 1) * sizeof(char));
+
+ while (length > 2) { /* keep going until we have less than 24 bits */
+ result[i++] = base64_table[current[0] >> 2];
+ result[i++] = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)];
+ result[i++] = base64_table[((current[1] & 0x0f) << 2) + (current[2] >> 6)];
+ result[i++] = base64_table[current[2] & 0x3f];
+
+ current += 3;
+ length -= 3; /* we just handle 3 octets of data */
+ }
+
+ /* now deal with the tail end of things */
+ if (length != 0) {
+ result[i++] = base64_table[current[0] >> 2];
+ if (length > 1) {
+ result[i++] = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)];
+ result[i++] = base64_table[(current[1] & 0x0f) << 2];
+ result[i++] = base64_pad;
+ }
+ else {
+ result[i++] = base64_table[(current[0] & 0x03) << 4];
+ result[i++] = base64_pad;
+ result[i++] = base64_pad;
+ }
+ }
+ if(ret_length) {
+ *ret_length = i;
+ }
+ result[i] = '\0';
+ return result;
+}
+/* }}} */
+
+/* {{{ */
+/* as above, but backwards. :) */
+unsigned char *xdebug_base64_decode(const unsigned char *str, int length, int *ret_length)
+{
+ const unsigned char *current = str;
+ int ch, i = 0, j = 0, k;
+ /* this sucks for threaded environments */
+ unsigned char *result;
+
+ result = (unsigned char *)emalloc(length + 1);
+ if (result == NULL) {
+ return NULL;
+ }
+
+ /* run through the whole string, converting as we go */
+ while ((ch = *current++) != '\0' && length-- > 0) {
+ if (ch == base64_pad) break;
+
+ /* When Base64 gets POSTed, all pluses are interpreted as spaces.
+ This line changes them back. It's not exactly the Base64 spec,
+ but it is completely compatible with it (the spec says that
+ spaces are invalid). This will also save many people considerable
+ headache. - Turadg Aleahmad <turadg[@]wise.berkeley.edu>
+ */
+
+ if (ch == ' ') ch = '+';
+
+ ch = base64_reverse_table[ch];
+ if (ch < 0) continue;
+
+ switch(i % 4) {
+ case 0:
+ result[j] = ch << 2;
+ break;
+ case 1:
+ result[j++] |= ch >> 4;
+ result[j] = (ch & 0x0f) << 4;
+ break;
+ case 2:
+ result[j++] |= ch >>2;
+ result[j] = (ch & 0x03) << 6;
+ break;
+ case 3:
+ result[j++] |= ch;
+ break;
+ }
+ i++;
+ }
+
+ k = j;
+ /* mop things up if we ended on a boundary */
+ if (ch == base64_pad) {
+ switch(i % 4) {
+ case 0:
+ case 1:
+ efree(result);
+ return NULL;
+ case 2:
+ k++;
+ case 3:
+ result[k++] = 0;
+ }
+ }
+ if(ret_length) {
+ *ret_length = j;
+ }
+ result[j] = '\0';
+ return result;
+}
+/* }}} */
+
 #endif
 
+#ifdef ZEND_ENGINE_2
 
 #define T(offset) (*(temp_variable *)((char *) Ts + offset))
 
@@ -75,7 +312,11 @@
                                         || ((int)T->str_offset.offset<0)
                                         || (T->str_offset.str->value.str.len <= T->str_offset.offset)) {
                                         zend_error(E_NOTICE, "Uninitialized string offset: %d", T->str_offset.offset);
+#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION == 6
                                         T->tmp_var.value.str.val = STR_EMPTY_ALLOC();
+#else
+ T->tmp_var.value.str.val = empty_string;
+#endif
                                         T->tmp_var.value.str.len = 0;
                                 } else {
                                         char c = str->value.str.val[T->str_offset.offset];
@@ -95,3 +336,75 @@
         }
         return NULL;
 }
+
+#else
+
+static zval get_overloaded_property(temp_variable *T TSRMLS_DC)
+{
+ zval result;
+
+ result = Z_OBJCE_P(T->EA.data.overloaded_element.object)->handle_property_get(&T->EA.data.overloaded_element);
+
+ zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
+ efree(T->EA.data.overloaded_element.elements_list);
+ return result;
+}
+
+zval *xdebug_zval_ptr(znode *node, temp_variable *Ts TSRMLS_DC)
+{
+ switch(node->op_type) {
+ case IS_CONST:
+ return &node->u.constant;
+ break;
+ case IS_TMP_VAR:
+ return &Ts[node->u.var].tmp_var;
+ break;
+ case IS_VAR:
+ if (Ts[node->u.var].var.ptr) {
+ return Ts[node->u.var].var.ptr;
+ } else {
+
+ switch (Ts[node->u.var].EA.type) {
+ case IS_OVERLOADED_OBJECT:
+ Ts[node->u.var].tmp_var = get_overloaded_property(&Ts[node->u.var] TSRMLS_CC);
+ Ts[node->u.var].tmp_var.refcount=1;
+ Ts[node->u.var].tmp_var.is_ref=1;
+ return &Ts[node->u.var].tmp_var;
+ break;
+ case IS_STRING_OFFSET: {
+ temp_variable *T = &Ts[node->u.var];
+ zval *str = T->EA.data.str_offset.str;
+
+ if (T->EA.data.str_offset.str->type != IS_STRING
+ || (T->EA.data.str_offset.offset<0)
+ || (T->EA.data.str_offset.str->value.str.len <= T->EA.data.str_offset.offset)) {
+ zend_error(E_NOTICE, "Uninitialized string offset: %d", T->EA.data.str_offset.offset);
+#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1
+ T->tmp_var.value.str.val = STR_EMPTY_ALLOC();
+#else
+ T->tmp_var.value.str.val = empty_string;
+#endif
+ T->tmp_var.value.str.len = 0;
+ } else {
+ char c = str->value.str.val[T->EA.data.str_offset.offset];
+
+ T->tmp_var.value.str.val = estrndup(&c, 1);
+ T->tmp_var.value.str.len = 1;
+ }
+ T->tmp_var.refcount=1;
+ T->tmp_var.is_ref=1;
+ T->tmp_var.type = IS_STRING;
+ return &T->tmp_var;
+ }
+ break;
+ }
+ }
+ break;
+ case IS_UNUSED:
+ return NULL;
+ break;
+ }
+ return NULL;
+}
+
+#endif

[FILE: /xdebug/xdebug_compat.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -r1.11 -r1.11.2.1
--- xdebug/xdebug_compat.h:1.11 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_compat.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -21,21 +21,30 @@
 
 #include "php.h"
 
-#if PHP_MAJOR_VERSION >= 6
+#if ((PHP_MAJOR_VERSION == 4) && (PHP_MINOR_VERSION == 3) && (PHP_RELEASE_VERSION <= 1)) || PHP_MAJOR_VERSION >= 6
 
 void xdebug_php_var_dump(zval **struc, int level TSRMLS_DC);
 
 #else
 
-# include "ext/standard/php_var.h"
-# define xdebug_php_var_dump php_var_dump
+# include "ext/standard/php_var.h"
+# define xdebug_php_var_dump php_var_dump
 
 #endif
 
 
-#include "ext/standard/base64.h"
-#define xdebug_base64_encode php_base64_encode
-#define xdebug_base64_decode php_base64_decode
+#if (PHP_MAJOR_VERSION == 4) && (PHP_MINOR_VERSION == 3) && (PHP_RELEASE_VERSION <= 4)
+
+unsigned char *xdebug_base64_encode(const unsigned char *, int, int *);
+unsigned char *xdebug_base64_decode(const unsigned char *str, int length, int *ret_length);
+
+#else
+
+# include "ext/standard/base64.h"
+# define xdebug_base64_encode php_base64_encode
+# define xdebug_base64_decode php_base64_decode
+
+#endif
 
 zval *xdebug_zval_ptr(znode *node, temp_variable *Ts TSRMLS_DC);
 

[FILE: /xdebug/xdebug_handler_dbgp.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.138
retrieving revision 1.138.2.1
diff -u -r1.138 -r1.138.2.1
--- xdebug/xdebug_handler_dbgp.c:1.138 Sat Jul 04 12:31:44 2009 GMT
+++ xdebug/xdebug_handler_dbgp.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -33,7 +33,6 @@
 #include "php_globals.h"
 #include "php_xdebug.h"
 #include "xdebug_private.h"
-#include "xdebug_code_coverage.h"
 #include "xdebug_com.h"
 #include "xdebug_handler_dbgp.h"
 #include "xdebug_hash.h"
@@ -168,7 +167,6 @@
 
 /* Non standard comments */
 DBGP_FUNC(xcmd_profiler_name_get);
-DBGP_FUNC(xcmd_get_executable_lines);
 
 /*****************************************************************************
 ** Dispatcher tables for supported debug commands
@@ -211,8 +209,7 @@
         DBGP_STOP_FUNC_ENTRY(detach, XDEBUG_DBGP_NONE)
 
         /* Non standard functions */
- DBGP_FUNC_ENTRY(xcmd_profiler_name_get, XDEBUG_DBGP_POST_MORTEM)
- DBGP_FUNC_ENTRY(xcmd_get_executable_lines, XDEBUG_DBGP_NONE)
+ DBGP_FUNC_ENTRY(xcmd_profiler_name_get, XDEBUG_DBGP_POST_MORTEM)
         { NULL, NULL }
 };
 
@@ -274,45 +271,6 @@
 #define XF_ST_ARRAY_INDEX_ASSOC 2
 #define XF_ST_OBJ_PROPERTY 3
 
-inline static HashTable *fetch_ht_from_zval(zval *z TSRMLS_DC)
-{
- switch (Z_TYPE_P(z)) {
- case IS_ARRAY:
- return Z_ARRVAL_P(z);
- break;
- case IS_OBJECT:
- return Z_OBJPROP_P(z);
- break;
- }
- return NULL;
-}
-
-inline static char *fetch_classname_from_zval(zval *z, int *length TSRMLS_DC)
-{
- char *name;
- zend_uint name_len;
-
- if (Z_TYPE_P(z) != IS_OBJECT) {
- return NULL;
- }
-
- if (Z_OBJ_HT_P(z)->get_class_name == NULL ||
- Z_OBJ_HT_P(z)->get_class_name(z, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
- zend_class_entry *ce;
-
- ce = zend_get_class_entry(z TSRMLS_CC);
- if (!ce) {
- return NULL;
- }
-
- *length = ce->name_length;
- return estrdup(ce->name);
- }
-
- *length = name_len;
- return name;
-}
-
 static char* prepare_search_key(char *name, int *name_length, char *prefix, int prefix_length)
 {
         char *element;
@@ -345,36 +303,9 @@
 
         switch (type) {
                 case XF_ST_ROOT:
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
- /* Check for compiled vars */
- element = prepare_search_key(name, &element_length, "", 0);
- if (XG(active_execute_data) && XG(active_op_array)) {
- int i = 0;
- ulong hash_value = zend_inline_hash_func(element, element_length + 1);
- zend_op_array *opa = XG(active_op_array);
- zval ***CVs = XG(active_execute_data)->CVs;
-
- while (i < opa->last_var) {
- if (opa->vars[i].hash_value == hash_value &&
- opa->vars[i].name_len == element_length &&
- strcmp(opa->vars[i].name, element) == 0)
- {
- if (CVs[i]) {
- retval_p = *CVs[i];
- goto cleanup;
- }
- }
- i++;
- }
- }
- free(element);
-#else
- ht = XG(active_symbol_table);
- /* break intentionally missing */
-#endif
                 case XF_ST_ARRAY_INDEX_ASSOC:
                         element = prepare_search_key(name, &name_length, "", 0);
-
+#ifdef ZEND_ENGINE_2
                         /* Handle "this" in a different way */
                         if (type == XF_ST_ROOT && strcmp("this", element) == 0) {
                                 if (XG(active_execute_data)) {
@@ -384,7 +315,7 @@
                                 }
                                 goto cleanup;
                         }
-
+#endif
                         if (ht && zend_hash_find(ht, element, name_length + 1, (void **) &retval_pp) == SUCCESS) {
                                 retval_p = *retval_pp;
                                 goto cleanup;
@@ -430,50 +361,170 @@
         return retval_p;
 }
 
+inline static HashTable *fetch_ht_from_zval(zval *z TSRMLS_DC)
+{
+ switch (Z_TYPE_P(z)) {
+ case IS_ARRAY:
+ return Z_ARRVAL_P(z);
+ break;
+ case IS_OBJECT:
+ return Z_OBJPROP_P(z);
+ break;
+ }
+ return NULL;
+}
+
+inline static char *fetch_classname_from_zval(zval *z, int *length TSRMLS_DC)
+{
+ if (Z_TYPE_P(z) != IS_OBJECT) {
+ return NULL;
+ }
+#if PHP_MAJOR_VERSION == 4
+ {
+ zend_class_entry *ce;
+ ce = Z_OBJCE_P(z);
+ *length = ce->name_length;
+ return estrdup(ce->name);
+ }
+#endif
+#if PHP_MAJOR_VERSION >= 5
+ {
+ char *name;
+ zend_uint name_len;
+
+ if (Z_OBJ_HT_P(z)->get_class_name == NULL ||
+ Z_OBJ_HT_P(z)->get_class_name(z, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
+ zend_class_entry *ce;
+
+ ce = zend_get_class_entry(z TSRMLS_CC);
+ if (!ce) {
+ return NULL;
+ }
+
+ *length = ce->name_length;
+ return estrdup(ce->name);
+ }
+
+ *length = name_len;
+ return name;
+ }
+#endif
+ return NULL;
+}
+
 static zval* get_symbol_contents_zval(char* name, int name_length TSRMLS_DC)
 {
- HashTable *st = NULL;
- int found = -1;
- int state = 0;
- char **p = &name;
- char *keyword = NULL, *keyword_end = NULL;
- int type = XF_ST_ROOT;
- zval *retval = NULL;
- char *current_classname = NULL;
- int cc_length = 0;
- char quotechar = 0;
+ HashTable *st = NULL;
 
- do {
- if (*p[0] == '\0') {
- found = 0;
- } else {
- switch (state) {
- case 0:
- if (*p[0] == '$') {
- keyword = *p + 1;
+ if (name[0] == '$') {
+ /* This is a fullname property. Relying on eval is bad as it can bail
+ * out, so we do it ourselves. */
+ int found = -1;
+ int state = 0;
+ char **p = &name;
+ char *keyword = NULL, *keyword_end = NULL;
+ int type = XF_ST_ROOT;
+ zval *retval = NULL;
+ char *current_classname = NULL;
+ int cc_length = 0;
+ char quotechar = 0;
+
+ /* Set the target table to the currently active scope */
+ st = XG(active_symbol_table);
+
+ do {
+ if (*p[0] == '\0') {
+ found = 0;
+ } else {
+ switch (state) {
+ case 0:
+ if (*p[0] == '$') {
+ state = 1;
+ keyword = *p + 1;
+ break;
+ }
+ keyword = *p;
+ /* break intentionally missing */
+ case 1:
+ if (*p[0] == '[') {
+ keyword_end = *p;
+ if (keyword) {
+ retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword, type, current_classname, cc_length TSRMLS_CC);
+ if (current_classname) {
+ efree(current_classname);
+ }
+ current_classname = NULL;
+ if (retval) {
+ st = fetch_ht_from_zval(retval TSRMLS_CC);
+ }
+ keyword = NULL;
+ }
+ state = 3;
+ } else if (*p[0] == '-') {
+ keyword_end = *p;
+ if (keyword) {
+ retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword, type, current_classname, cc_length TSRMLS_CC);
+ if (current_classname) {
+ efree(current_classname);
+ }
+ current_classname = NULL;
+ if (retval) {
+ current_classname = fetch_classname_from_zval(retval, &cc_length TSRMLS_CC);
+ st = fetch_ht_from_zval(retval TSRMLS_CC);
+ }
+ keyword = NULL;
+ }
+ state = 2;
+ type = XF_ST_OBJ_PROPERTY;
+ }
                                                 break;
- }
- keyword = *p;
- state = 1;
- /* break intentionally missing */
- case 1:
- if (*p[0] == '[') {
- keyword_end = *p;
- if (keyword) {
+ case 2:
+ if (*p[0] != '>') {
+ keyword = *p;
+ state = 1;
+ }
+ break;
+ case 3:
+ /* Associative arrays */
+ if (*p[0] == '\'' || *p[0] == '"') {
+ state = 4;
+ keyword = *p + 1;
+ quotechar = *p[0];
+ type = XF_ST_ARRAY_INDEX_ASSOC;
+ }
+ /* Numerical index */
+ if (*p[0] >= '0' && *p[0] <= '9') {
+ state = 6;
+ keyword = *p;
+ type = XF_ST_ARRAY_INDEX_NUM;
+ }
+ break;
+ case 4:
+ if (*p[0] == quotechar) {
+ quotechar = 0;
+ state = 5;
+ keyword_end = *p;
                                                         retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword, type, current_classname, cc_length TSRMLS_CC);
                                                         if (current_classname) {
                                                                 efree(current_classname);
                                                         }
                                                         current_classname = NULL;
                                                         if (retval) {
+ current_classname = fetch_classname_from_zval(retval, &cc_length TSRMLS_CC);
                                                                 st = fetch_ht_from_zval(retval TSRMLS_CC);
                                                         }
                                                         keyword = NULL;
                                                 }
- state = 3;
- } else if (*p[0] == '-') {
- keyword_end = *p;
- if (keyword) {
+ break;
+ case 5:
+ if (*p[0] == ']') {
+ state = 1;
+ }
+ break;
+ case 6:
+ if (*p[0] == ']') {
+ state = 1;
+ keyword_end = *p;
                                                         retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword, type, current_classname, cc_length TSRMLS_CC);
                                                         if (current_classname) {
                                                                 efree(current_classname);
@@ -485,80 +536,40 @@
                                                         }
                                                         keyword = NULL;
                                                 }
- state = 2;
- type = XF_ST_OBJ_PROPERTY;
- }
- break;
- case 2:
- if (*p[0] != '>') {
- keyword = *p;
- state = 1;
- }
- break;
- case 3:
- /* Associative arrays */
- if (*p[0] == '\'' || *p[0] == '"') {
- state = 4;
- keyword = *p + 1;
- quotechar = *p[0];
- type = XF_ST_ARRAY_INDEX_ASSOC;
- }
- /* Numerical index */
- if (*p[0] >= '0' && *p[0] <= '9') {
- state = 6;
- keyword = *p;
- type = XF_ST_ARRAY_INDEX_NUM;
- }
- break;
- case 4:
- if (*p[0] == quotechar) {
- quotechar = 0;
- state = 5;
- keyword_end = *p;
- retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword, type, current_classname, cc_length TSRMLS_CC);
- if (current_classname) {
- efree(current_classname);
- }
- current_classname = NULL;
- if (retval) {
- current_classname = fetch_classname_from_zval(retval, &cc_length TSRMLS_CC);
- st = fetch_ht_from_zval(retval TSRMLS_CC);
- }
- keyword = NULL;
- }
- break;
- case 5:
- if (*p[0] == ']') {
- state = 1;
- }
- break;
- case 6:
- if (*p[0] == ']') {
- state = 1;
- keyword_end = *p;
- retval = fetch_zval_from_symbol_table(st, keyword, keyword_end - keyword, type, current_classname, cc_length TSRMLS_CC);
- if (current_classname) {
- efree(current_classname);
- }
- current_classname = NULL;
- if (retval) {
- current_classname = fetch_classname_from_zval(retval, &cc_length TSRMLS_CC);
- st = fetch_ht_from_zval(retval TSRMLS_CC);
- }
- keyword = NULL;
- }
- break;
+ break;
+ }
+ (*p)++;
+ }
+ } while (found < 0);
+ if (keyword != NULL) {
+ retval = fetch_zval_from_symbol_table(st, keyword, *p - keyword, type, current_classname, cc_length TSRMLS_CC);
+ if (retval) {
+ st = fetch_ht_from_zval(retval TSRMLS_CC);
+ }
+ }
+ return retval;
+ } else {
+ zval **retval;
+
+ st = XG(active_symbol_table);
+ if (st && zend_hash_find(st, name, name_length, (void **) &retval) == SUCCESS) {
+ return *retval;
+ }
+
+ st = EG(active_op_array)->static_variables;
+ if (st) {
+ if (zend_hash_find(st, name, name_length, (void **) &retval) == SUCCESS) {
+ return *retval;
                         }
- (*p)++;
                 }
- } while (found < 0);
- if (keyword != NULL) {
- retval = fetch_zval_from_symbol_table(st, keyword, *p - keyword, type, current_classname, cc_length TSRMLS_CC);
- if (retval) {
- st = fetch_ht_from_zval(retval TSRMLS_CC);
+#if 0
+ st = &EG(symbol_table);
+ if (zend_hash_find(st, name, name_length, (void **) &retval) == SUCCESS) {
+ return *retval;
                 }
+#endif
         }
- return retval;
+ return NULL;
 }
 
 static xdebug_xml_node* get_symbol(char* name, int name_length, xdebug_var_export_options *options TSRMLS_DC)
@@ -1086,7 +1097,7 @@
                 brk_info->hit_value = strtol(CMD_OPTION('h'), NULL, 10);
         }
 
- if ((strcmp(CMD_OPTION('t'), "line") == 0) || (strcmp(CMD_OPTION('t'), "conditional") == 0)) {
+ if (strcmp(CMD_OPTION('t'), "line") == 0) {
                 if (!CMD_OPTION('n')) {
                         RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_INVALID_ARGS);
                 }
@@ -1149,7 +1160,12 @@
                 }
         } else
 
+ if (strcmp(CMD_OPTION('t'), "conditional") == 0) {
+ RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_BREAKPOINT_TYPE_NOT_SUPPORTED);
+ } else
+
         if (strcmp(CMD_OPTION('t'), "exception") == 0) {
+#if PHP_MAJOR_VERSION >= 5
                 if (!CMD_OPTION('x')) {
                         RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_INVALID_ARGS);
                 }
@@ -1159,6 +1175,9 @@
                 } else {
                         brk_id = breakpoint_admin_add(context, BREAKPOINT_TYPE_EXCEPTION, CMD_OPTION('x'));
                 }
+#else
+ RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_BREAKPOINT_TYPE_NOT_SUPPORTED);
+#endif
         } else
 
         if (strcmp(CMD_OPTION('t'), "watch") == 0) {
@@ -1618,19 +1637,8 @@
         /* Set the symbol table corresponding with the requested stack depth */
         if (context_nr == 0) { /* locals */
                 if ((fse = xdebug_get_stack_frame(depth TSRMLS_CC))) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
- function_stack_entry *old_fse = xdebug_get_stack_frame(depth - 1 TSRMLS_CC);
-
- if (depth > 0) {
- XG(active_execute_data) = old_fse->execute_data;
- } else {
- XG(active_execute_data) = EG(current_execute_data);
- }
-#else
- XG(active_execute_data) = fse->execute_data;
-#endif
                         XG(active_symbol_table) = fse->symbol_table;
- XG(active_op_array) = fse->op_array;
+ XG(active_execute_data) = fse->execute_data;
                 } else {
                         RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_STACK_DEPTH_INVALID);
                 }
@@ -1653,7 +1661,6 @@
                 options->max_data = old_max_data;
                 RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_PROPERTY_NON_EXISTANT);
         }
- XG(active_op_array) = NULL;
 }
 
 DBGP_FUNC(property_set)
@@ -1690,19 +1697,8 @@
         /* Set the symbol table corresponding with the requested stack depth */
         if (context_nr == 0) { /* locals */
                 if ((fse = xdebug_get_stack_frame(depth TSRMLS_CC))) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
- function_stack_entry *old_fse = xdebug_get_stack_frame(depth - 1 TSRMLS_CC);
-
- if (depth > 0) {
- XG(active_execute_data) = old_fse->execute_data;
- } else {
- XG(active_execute_data) = EG(current_execute_data);
- }
-#else
- XG(active_execute_data) = fse->execute_data;
-#endif
                         XG(active_symbol_table) = fse->symbol_table;
- XG(active_op_array) = fse->op_array;
+ XG(active_execute_data) = fse->execute_data;
                 } else {
                         RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_STACK_DEPTH_INVALID);
                 }
@@ -1802,19 +1798,8 @@
 
         /* Set the symbol table corresponding with the requested stack depth */
         if ((fse = xdebug_get_stack_frame(depth TSRMLS_CC))) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
- function_stack_entry *old_fse = xdebug_get_stack_frame(depth - 1 TSRMLS_CC);
-
- if (depth > 0) {
- XG(active_execute_data) = old_fse->execute_data;
- } else {
- XG(active_execute_data) = EG(current_execute_data);
- }
-#else
- XG(active_execute_data) = fse->execute_data;
-#endif
                 XG(active_symbol_table) = fse->symbol_table;
- XG(active_op_array) = fse->op_array;
+ XG(active_execute_data) = fse->execute_data;
         } else {
                 RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_STACK_DEPTH_INVALID);
         }
@@ -1844,7 +1829,7 @@
         xdebug_xml_node *contents;
         TSRMLS_FETCH();
 
- contents = get_symbol(name, strlen(name), options TSRMLS_CC);
+ contents = get_symbol(name, strlen(name) + 1, options TSRMLS_CC);
         if (contents) {
                 xdebug_xml_add_child(node, contents);
         } else {
@@ -1885,19 +1870,8 @@
 
         /* Here the context_id is 0 */
         if ((fse = xdebug_get_stack_frame(depth TSRMLS_CC))) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION >= 6
- function_stack_entry *old_fse = xdebug_get_stack_frame(depth - 1 TSRMLS_CC);
-
- if (depth > 0) {
- XG(active_execute_data) = old_fse->execute_data;
- } else {
- XG(active_execute_data) = EG(current_execute_data);
- }
-#else
- XG(active_execute_data) = fse->execute_data;
-#endif
                 XG(active_symbol_table) = fse->symbol_table;
- XG(active_op_array) = fse->op_array;
+ XG(active_execute_data) = fse->execute_data;
 
                 /* Only show vars when they are scanned */
                 if (fse->used_vars) {
@@ -1907,12 +1881,13 @@
                         xdebug_hash_destroy(tmp_hash);
                 }
 
+#ifdef ZEND_ENGINE_2
                 /* zend engine 2 does not give us $this, eval so we can get it */
                 add_variable_node(node, "$this", sizeof("$this"), 1, 1, 0, options TSRMLS_CC);
+#endif
 
                 XG(active_symbol_table) = NULL;
                 XG(active_execute_data) = NULL;
- XG(active_op_array) = NULL;
                 return 0;
         }
         
@@ -2005,34 +1980,6 @@
         }
 }
 
-DBGP_FUNC(xcmd_get_executable_lines)
-{
- function_stack_entry *fse;
- int i, depth;
- xdebug_xml_node *lines, *line;
-
- if (!CMD_OPTION('d')) {
- RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_INVALID_ARGS);
- }
-
- depth = strtol(CMD_OPTION('d'), NULL, 10);
- if (depth >= 0 && depth < XG(level)) {
- fse = xdebug_get_stack_frame(depth TSRMLS_CC);
- } else {
- RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_STACK_DEPTH_INVALID);
- }
-
- lines = xdebug_xml_node_init("xdebug:lines");
- for (i = 0; i < fse->op_array->size; i++ ) {
- if (fse->op_array->opcodes[i].opcode == ZEND_EXT_STMT ) {
- line = xdebug_xml_node_init("xdebug:line");
- xdebug_xml_add_attribute_ex(line, "lineno", xdebug_sprintf("%lu", fse->op_array->opcodes[i].lineno), 0, 1);
- xdebug_xml_add_child(lines, line);
- }
- }
- xdebug_xml_add_child(*retval, lines);
-}
-
 
 /*****************************************************************************
 ** Parsing functions
@@ -2269,7 +2216,7 @@
 
 char *xdebug_dbgp_get_revision(void)
 {
- return "$Revision: 1.138 $";
+ return "$Revision: 1.138.2.1 $";
 }
 
 static int xdebug_dbgp_cmdloop(xdebug_con *context, int bail TSRMLS_DC)
@@ -2399,6 +2346,7 @@
         }
 
 /* {{{ Initialize auto globals in Zend Engine 2 */
+#ifdef ZEND_ENGINE_2
         zend_is_auto_global("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
         zend_is_auto_global("_GET", sizeof("_GET")-1 TSRMLS_CC);
         zend_is_auto_global("_POST", sizeof("_POST")-1 TSRMLS_CC);
@@ -2407,6 +2355,7 @@
         zend_is_auto_global("_FILES", sizeof("_FILES")-1 TSRMLS_CC);
         zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
         zend_is_auto_global("_SESSION", sizeof("_SESSION")-1 TSRMLS_CC);
+#endif
 /* }}} */
 
         context->breakpoint_list = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_admin_dtor);
@@ -2543,7 +2492,7 @@
         return 1;
 }
 
-int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *message)
+int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, const 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.23
retrieving revision 1.23.2.1
diff -u -r1.23 -r1.23.2.1
--- xdebug/xdebug_handler_dbgp.h:1.23 Sat Jul 04 12:31:44 2009 GMT
+++ xdebug/xdebug_handler_dbgp.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -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, char *file, long lineno, int type, char *exception, char *message);
+int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, const 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.92
retrieving revision 1.92.2.1
diff -u -r1.92 -r1.92.2.1
--- xdebug/xdebug_handler_gdb.c:1.92 Sat Jul 04 12:31:44 2009 GMT
+++ xdebug/xdebug_handler_gdb.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -1351,7 +1351,7 @@
 
 char *xdebug_gdb_get_revision(void)
 {
- return "$Revision: 1.92 $";
+ return "$Revision: 1.92.2.1 $";
 }
 
 int xdebug_gdb_init(xdebug_con *context, int mode)
@@ -1363,7 +1363,7 @@
         TSRMLS_FETCH();
 
         SENDMSG(context->socket, xdebug_sprintf("This is Xdebug version %s.\n", XDEBUG_VERSION));
- SSEND(context->socket, "Copyright 2002-2009 by Derick Rethans,\n");
+ SSEND(context->socket, "Copyright 2002, 2003, 2004, 2005, 2006, 2007 by Derick Rethans,\n");
         context->buffer = xdmalloc(sizeof(fd_buf));
         context->buffer->buffer = NULL;
         context->buffer->buffer_size = 0;
@@ -1374,6 +1374,7 @@
         options->dump_superglobals = 1;
 
         /* Initialize auto globals in Zend Engine 2 */
+#ifdef ZEND_ENGINE_2
         zend_is_auto_global("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
         zend_is_auto_global("_GET", sizeof("_GET")-1 TSRMLS_CC);
         zend_is_auto_global("_POST", sizeof("_POST")-1 TSRMLS_CC);
@@ -1381,6 +1382,7 @@
         zend_is_auto_global("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
         zend_is_auto_global("_FILES", sizeof("_FILES")-1 TSRMLS_CC);
         zend_is_auto_global("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
+#endif
 
         context->function_breakpoints = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_brk_dtor);
         context->exception_breakpoints = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_brk_dtor);
@@ -1461,7 +1463,7 @@
         return 1;
 }
 
-int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception_type, char *message)
+int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, const 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.33
retrieving revision 1.33.2.1
diff -u -r1.33 -r1.33.2.1
--- xdebug/xdebug_handler_gdb.h:1.33 Sat Jul 04 12:31:44 2009 GMT
+++ xdebug/xdebug_handler_gdb.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -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, char *file, long lineno, int type, char *exception_type, char *message);
+int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, const char *file, long lineno, int type, char *exception_type, char *message);
 char *xdebug_gdb_get_revision(void);
 
 #define xdebug_handler_gdb { \

[FILE: /xdebug/xdebug_handler_php3.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -u -r1.23 -r1.23.2.1
--- xdebug/xdebug_handler_php3.c:1.23 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handler_php3.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -74,7 +74,7 @@
 
 char *xdebug_php3_get_revision(void)
 {
- return "$Revision: 1.23 $";
+ return "$Revision: 1.23.2.1 $";
 }
 
 int xdebug_php3_init(xdebug_con *context, int mode)

[FILE: /xdebug/xdebug_handler_php3.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -r1.17 -r1.17.2.1
--- xdebug/xdebug_handler_php3.h:1.17 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handler_php3.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_handlers.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -r1.19 -r1.19.2.1
--- xdebug/xdebug_handlers.c:1.19 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_handlers.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_handlers.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.38
retrieving revision 1.38.2.1
diff -u -r1.38 -r1.38.2.1
--- xdebug/xdebug_handlers.h:1.38 Sat Jul 04 12:31:44 2009 GMT
+++ xdebug/xdebug_handlers.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -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, char *file, long lineno, int type, char *exception, char *message);
+ int (*remote_breakpoint)(xdebug_con *h, xdebug_llist *stack, const 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);

[FILE: /xdebug/xdebug_hash.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- xdebug/xdebug_hash.c:1.6 Thu Nov 27 17:56:26 2008 GMT
+++ xdebug/xdebug_hash.c Wed Jul 15 09:39:20 2009 GMT
@@ -1,4 +1,4 @@
-/* $Id: cvstemp,v 1.6 2008/11/27 18:56:26 derick Exp $ */
+/* $Id: cvstemp,v 1.6.2.1 2009/07/15 11:39:20 allisterb Exp $ */
 
 /* The contents of this file are subject to the Vulcan Logic Public
  * License Version 1.1 (the "License"); you may not use this file

[FILE: /xdebug/xdebug_mm.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- xdebug/xdebug_mm.h:1.8 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_mm.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_private.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- xdebug/xdebug_private.c:1.7 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_private.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_private.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -r1.28 -r1.28.2.1
--- xdebug/xdebug_private.h:1.28 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_private.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -70,8 +70,12 @@
 #define XDEBUG_TRACE_OPTION_COMPUTERIZED 2
 #define XDEBUG_TRACE_OPTION_HTML 4
 
-#define XDEBUG_CC_OPTION_UNUSED 1
-#define XDEBUG_CC_OPTION_DEAD_CODE 2
+#define XDEBUG_CC_OPTION_UNUSED 1
+#define XDEBUG_CC_OPTION_DEAD_CODE 2
+#define XDEBUG_CC_OPTION_DUMP_INSTRUCTION_COUNTS 3
+#define XDEBUG_CC_OPTION_BRANCH_ANALYSIS 4
+#define XDEBUG_CC_OPTION_PATH_ANALYSIS 5
+
 
 #define STATUS_STARTING 0
 #define STATUS_STOPPING 1

[FILE: /xdebug/xdebug_profiler.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.53
retrieving revision 1.53.2.1
diff -u -r1.53 -r1.53.2.1
--- xdebug/xdebug_profiler.c:1.53 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_profiler.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_profiler.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -r1.14 -r1.14.2.1
--- xdebug/xdebug_profiler.h:1.14 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_profiler.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_set.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- xdebug/xdebug_set.c:1.5 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_set.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
    | Authors: Derick Rethans <derick[@]xdebug.org> |
    +----------------------------------------------------------------------+
  */
-/* $Id: cvstemp,v 1.5 2009/05/07 20:39:13 derick Exp $ */
+/* $Id: cvstemp,v 1.5.2.1 2009/07/15 11:39:20 allisterb Exp $ */
 
 #include <stdlib.h>
 #include <math.h>

[FILE: /xdebug/xdebug_set.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- xdebug/xdebug_set.h:1.4 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_set.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -15,7 +15,7 @@
    | Authors: Derick Rethans <derick[@]xdebug.org> |
    +----------------------------------------------------------------------+
  */
-/* $Id: cvstemp,v 1.4 2009/05/07 20:39:13 derick Exp $ */
+/* $Id: cvstemp,v 1.4.2.1 2009/07/15 11:39:20 allisterb Exp $ */
 
 #ifndef __XDEBUG_SET_H__
 #define __XDEBUG_SET_H__

[FILE: /xdebug/xdebug_str.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -u -r1.10 -r1.10.2.1
--- xdebug/xdebug_str.c:1.10 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_str.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_str.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -u -r1.8 -r1.8.2.1
--- xdebug/xdebug_str.h:1.8 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_str.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_superglobals.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.29
retrieving revision 1.29.2.1
diff -u -r1.29 -r1.29.2.1
--- xdebug/xdebug_superglobals.c:1.29 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_superglobals.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_superglobals.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -r1.9 -r1.9.2.1
--- xdebug/xdebug_superglobals.h:1.9 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_superglobals.h Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.98
retrieving revision 1.98.2.1
diff -u -r1.98 -r1.98.2.1
--- xdebug/xdebug_var.c:1.98 Thu Jul 02 07:03:41 2009 GMT
+++ xdebug/xdebug_var.c Wed Jul 15 09:39:20 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |
@@ -58,9 +58,11 @@
                 case E_USER_NOTICE:
                         return xdstrdup("Notice");
                         break;
+#ifdef ZEND_ENGINE_2
                 case E_STRICT:
                         return xdstrdup("Strict standards");
                         break;
+#endif
 #if PHP_VERSION_ID >= 50300
                 case E_DEPRECATED:
                         return xdstrdup("Deprecated");
@@ -100,19 +102,19 @@
         return NULL;
 }
 
-static char* xdebug_get_property_info(char *mangled_property, int mangled_len, char **property_name, char **class_name)
+static char* xdebug_get_property_info(char *mangled_property, int mangled_len, char **property_name)
 {
- char *prop_name, *cls_name;
+#ifdef ZEND_ENGINE_2
+ char *prop_name, *class_name;
 
 #if PHP_VERSION_ID >= 50200
- zend_unmangle_property_name(mangled_property, mangled_len - 1, &cls_name, &prop_name);
+ zend_unmangle_property_name(mangled_property, mangled_len - 1, &class_name, &prop_name);
 #else
- zend_unmangle_property_name(mangled_property, &cls_name, &prop_name);
+ zend_unmangle_property_name(mangled_property, &class_name, &prop_name);
 #endif
         *property_name = prop_name;
- *class_name = cls_name;
- if (cls_name) {
- if (cls_name[0] == '*') {
+ if (class_name) {
+ if (class_name[0] == '*') {
                         return "protected";
                 } else {
                         return "private";
@@ -120,6 +122,10 @@
         } else {
                 return "public";
         }
+#else
+ *property_name = mangled_property;
+ return "var";
+#endif
 }
 
 
@@ -217,7 +223,7 @@
         int level, debug_zval;
         xdebug_str *str;
         xdebug_var_export_options *options;
- char *prop_name, *class_name, *modifier;
+ char *prop_name, *modifier;
 #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300
         TSRMLS_FETCH();
 #endif
@@ -231,7 +237,7 @@
                 options->runtime[level].current_element_nr < options->runtime[level].end_element_nr)
         {
                 if (hash_key->nKeyLength != 0) {
- modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &class_name);
+ modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name);
                         xdebug_str_add(str, xdebug_sprintf("%s $%s = ", modifier, prop_name), 1);
                 }
                 xdebug_var_export(zv, str, level + 2, debug_zval, options TSRMLS_CC);
@@ -467,14 +473,17 @@
 {
         int level;
         xdebug_str *str;
- char *prop_name, *class_name, *modifier;
+ char *prop_name, *modifier;
+#if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300
+ TSRMLS_FETCH();
+#endif
 
         level = va_arg(args, int);
         str = va_arg(args, struct xdebug_str*);
 
         xdebug_str_addl(str, "<var", 4, 0);
         if (hash_key->nKeyLength != 0) {
- modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &class_name);
+ modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name);
                 xdebug_str_add(str, xdebug_sprintf(" name='%s' facet='%s'", prop_name, modifier), 1);
         }
         xdebug_str_add(str, xdebug_sprintf(" id='%p'>", *zv), 1);
@@ -639,7 +648,7 @@
         xdebug_xml_node *parent;
         xdebug_xml_node *node;
         xdebug_var_export_options *options;
- char *prop_name, *modifier, *class_name, *prop_class_name;
+ char *prop_name, *modifier;
         char *parent_name = NULL, *full_name = NULL;
 #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300
         TSRMLS_FETCH();
@@ -649,37 +658,31 @@
         parent = va_arg(args, xdebug_xml_node*);
         full_name = parent_name = va_arg(args, char *);
         options = va_arg(args, xdebug_var_export_options*);
- class_name = va_arg(args, char *);
 
         if (options->runtime[level].current_element_nr >= options->runtime[level].start_element_nr &&
                 options->runtime[level].current_element_nr < options->runtime[level].end_element_nr)
         {
                 node = xdebug_xml_node_init("property");
-
+
                 if (hash_key->nKeyLength != 0) {
- modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &prop_class_name);
+ modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name);
                         xdebug_xml_add_attribute(node, "name", prop_name);
+ /* XXX static vars? */
 
- if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) {
- if (parent_name) {
- if (parent_name[0] != '$') {
- full_name = xdebug_sprintf("$%s->%s", parent_name, prop_name);
- } else {
- full_name = xdebug_sprintf("%s->%s", parent_name, prop_name);
- }
- xdebug_xml_add_attribute_ex(node, "fullname", full_name, 0, 1);
+ if (parent_name) {
+ if (parent_name[0] != '$') {
+ full_name = xdebug_sprintf("$%s->%s", parent_name, prop_name);
+ } else {
+ full_name = xdebug_sprintf("%s->%s", parent_name, prop_name);
                                 }
+ xdebug_xml_add_attribute_ex(node, "fullname", full_name, 0, 1);
                         }
                         xdebug_xml_add_attribute(node, "facet", modifier);
-
- xdebug_xml_add_attribute_ex(node, "address", xdebug_sprintf("%ld", (long) *zv), 0, 1);
-
- xdebug_xml_add_child(parent, node);
-
- if (strcmp(modifier, "private") != 0 || strcmp(class_name, prop_class_name) == 0) {
- xdebug_var_export_xml_node(zv, full_name, node, options, level + 1 TSRMLS_CC);
- }
                 }
+ xdebug_xml_add_attribute_ex(node, "address", xdebug_sprintf("%ld", (long) *zv), 0, 1);
+
+ xdebug_xml_add_child(parent, node);
+ xdebug_var_export_xml_node(zv, full_name, node, options, level + 1 TSRMLS_CC);
         }
         options->runtime[level].current_element_nr++;
         return 0;
@@ -688,8 +691,10 @@
 void xdebug_var_export_xml_node(zval **struc, char *name, xdebug_xml_node *node, xdebug_var_export_options *options, int level TSRMLS_DC)
 {
         HashTable *myht;
+#ifdef ZEND_ENGINE_2
         char *class_name;
         zend_uint class_name_len;
+#endif
 
         switch (Z_TYPE_PP(struc)) {
                 case IS_BOOL:
@@ -747,23 +752,15 @@
 
                 case IS_OBJECT:
                         myht = Z_OBJPROP_PP(struc);
-
                         xdebug_xml_add_attribute(node, "type", "object");
                         xdebug_xml_add_attribute(node, "children", (myht && zend_hash_num_elements(myht))?"1":"0");
+#ifdef ZEND_ENGINE_2
                         Z_OBJ_HANDLER(**struc, get_class_name)(*struc, &class_name, &class_name_len, 0 TSRMLS_CC);
                         xdebug_xml_add_attribute_ex(node, "classname", xdstrdup(class_name), 0, 1);
-
- /** Temporary additional property **/
- {
- xdebug_xml_node *pnode;
-
- pnode = xdebug_xml_node_init("property");
- xdebug_xml_add_attribute(pnode, "name", "CLASSNAME");
- xdebug_xml_add_attribute(pnode, "type", "string");
- xdebug_xml_add_text(pnode, xdstrdup(class_name));
- xdebug_xml_add_child(node, pnode);
- }
-
+ efree(class_name);
+#else
+ xdebug_xml_add_attribute_ex(node, "classname", xdstrdup(Z_OBJCE_PP(struc)->name), 0, 1);
+#endif
                         if (myht) {
                                 if (myht->nApplyCount < 1) {
                                         xdebug_xml_add_attribute_ex(node, "numchildren", xdebug_sprintf("%d", zend_hash_num_elements(myht)), 0, 1);
@@ -778,13 +775,12 @@
                                                         options->runtime[level].start_element_nr = 0;
                                                         options->runtime[level].end_element_nr = options->max_children;
                                                 }
- zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export_xml_node, 5, level, node, name, options, class_name);
+ zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export_xml_node, 4, level, node, name, options);
                                         }
                                 } else {
                                         xdebug_xml_add_attribute(node, "recursive", "1");
                                 }
                         }
- efree(class_name);
                         break;
 
                 case IS_RESOURCE: {
@@ -884,7 +880,7 @@
         xdebug_str *str;
         xdebug_var_export_options *options;
         char *key;
- char *prop_name, *class_name, *modifier;
+ char *prop_name, *modifier;
 #if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300
         TSRMLS_FETCH();
 #endif
@@ -901,7 +897,7 @@
 
                 key = hash_key->arKey;
                 if (hash_key->nKeyLength != 0) {
- modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name, &class_name);
+ modifier = xdebug_get_property_info(hash_key->arKey, hash_key->nKeyLength, &prop_name);
                         xdebug_str_add(str, xdebug_sprintf("<i>%s</i> '%s' <font color='%s'>=&gt;</font> ", modifier, prop_name, COLOR_POINTER), 1);
                 }
                 xdebug_var_export_fancy(zv, str, level + 1, debug_zval, options TSRMLS_CC);
@@ -977,7 +973,8 @@
                                                 xdebug_str_add(str, xdebug_sprintf("<i><font color='%s'>empty</font></i>\n", COLOR_EMPTY), 1);
                                         }
                                 } else {
- xdebug_str_add(str, xdebug_sprintf("%*s...\n", (level * 4) - 2, ""), 1);
+ xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1);
+ xdebug_str_add(str, xdebug_sprintf("...\n"), 1);
                                 }
                         } else {
                                 xdebug_str_addl(str, "<i>&</i><b>array</b>\n", 21, 0);
@@ -989,7 +986,11 @@
                         xdebug_str_add(str, xdebug_sprintf("\n%*s", (level - 1) * 4, ""), 1);
                         if (myht->nApplyCount < 1) {
                                 xdebug_str_add(str, xdebug_sprintf("<b>object</b>(<i>%s</i>)", Z_OBJCE_PP(struc)->name), 1);
+#ifdef ZEND_ENGINE_2
                                 xdebug_str_add(str, xdebug_sprintf("[<i>%d</i>]\n", Z_OBJ_HANDLE_PP(struc)), 1);
+#else
+ xdebug_str_addl(str, "\n", 1, 0);
+#endif
                                 if (level <= options->max_depth) {
                                         options->runtime[level].current_element_nr = 0;
                                         options->runtime[level].start_element_nr = 0;
@@ -997,11 +998,16 @@
 
                                         zend_hash_apply_with_arguments(myht XDEBUG_ZEND_HASH_APPLY_TSRMLS_CC, (apply_func_args_t) xdebug_object_element_export_fancy, 4, level, str, debug_zval, options);
                                 } else {
- xdebug_str_add(str, xdebug_sprintf("%*s...\n", (level * 4) - 2, ""), 1);
+ xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1);
+ xdebug_str_add(str, xdebug_sprintf("...\n"), 1);
                                 }
                         } else {
                                 xdebug_str_add(str, xdebug_sprintf("<i>&</i><b>object</b>(<i>%s</i>)", Z_OBJCE_PP(struc)->name), 1);
+#ifdef ZEND_ENGINE_2
                                 xdebug_str_add(str, xdebug_sprintf("[<i>%d</i>]\n", Z_OBJ_HANDLE_PP(struc)), 1);
+#else
+ xdebug_str_addl(str, "\n", 1, 0);
+#endif
                         }
                         break;
 
@@ -1079,7 +1085,9 @@
 
                 case IS_OBJECT:
                         xdebug_str_add(str, xdebug_sprintf("<font color='%s'>object(%s)", COLOR_OBJECT, Z_OBJCE_PP(struc)->name), 1);
+#ifdef ZEND_ENGINE_2
                         xdebug_str_add(str, xdebug_sprintf("[%d]", Z_OBJ_HANDLE_PP(struc)), 1);
+#endif
                         xdebug_str_addl(str, "</font>", 7, 0);
                         break;
 

[FILE: /xdebug/xdebug_var.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -r1.28 -r1.28.2.1
--- xdebug/xdebug_var.h:1.28 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_var.h Wed Jul 15 09:39:21 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_xml.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -r1.14 -r1.14.2.1
--- xdebug/xdebug_xml.c:1.14 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_xml.c Wed Jul 15 09:39:21 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xdebug_xml.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- xdebug/xdebug_xml.h:1.7 Thu May 07 18:39:13 2009 GMT
+++ xdebug/xdebug_xml.h Wed Jul 15 09:39:21 2009 GMT
@@ -2,7 +2,7 @@
    +----------------------------------------------------------------------+
    | Xdebug |
    +----------------------------------------------------------------------+
- | Copyright (c) 2002-2009 Derick Rethans |
+ | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
    +----------------------------------------------------------------------+
    | This source file is subject to version 1.0 of the Xdebug license, |
    | that is bundled with this package in the file LICENSE, and is |

[FILE: /xdebug/xt.vim]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- xdebug/xt.vim:1.4 Sun Jan 04 20:34:08 2009 GMT
+++ xdebug/xt.vim Wed Jul 15 09:39:21 2009 GMT
@@ -23,8 +23,6 @@
 syn match lineno ":\d\+$"
 
 syn match result ">=>.\+"
-syn match assignment "=> \$[a-z]\+\(->[a-z]\+\)*\ .*="
-syn match assignment "=> \$[a-z]\+\['\([a-z]\+\)*'\]\ .*="
 
 syn match methodcall "\k\+->"
 syn match staticcall "\k\+::"
@@ -48,7 +46,6 @@
   HiLink begin Label
   HiLink end Label
   HiLink date Label
- HiLink assignment Label
 
   HiLink level SpecialChar
   HiLink result Constant
Received on Wed Jul 15 2009 - 14:06:19 BST

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