[xdebug-dev] xdebug xdebug/php_xdebug.h xdebug/xdebug.c xdebug/xdebug_code_coverage.c xdebug/xdebug_compat.c xdebug/xdebug_compat.h xdebug/xdebug_handler_dbgp.c xdebug/xdebug_handler_gdb.c xdebug/xdebug_var.c - Ripped out support for PHP 4 and PHP 5.0.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Mon, 5 Jan 2009 18:24:34 +0100

Date: Mon Jan 5 18:24:34 CET 2009
User: Derick Rethans
Directory: xdebug

Log Message:
[0.50]
- Ripped out support for PHP 4 and PHP 5.0.

Modified files:
           xdebug/php_xdebug.h (version: 1.145)
           xdebug/xdebug.c (version: 1.441)
           xdebug/xdebug_code_coverage.c (version: 1.46)
           xdebug/xdebug_compat.c (version: 1.12)
           xdebug/xdebug_compat.h (version: 1.9)
           xdebug/xdebug_handler_dbgp.c (version: 1.135)
           xdebug/xdebug_handler_gdb.c (version: 1.89)
           xdebug/xdebug_var.c (version: 1.92)

[FILE: /xdebug/php_xdebug.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -r1.144 -r1.145
--- xdebug/php_xdebug.h:1.144 Sun Jan 04 20:34:08 2009 GMT
+++ xdebug/php_xdebug.h Mon Jan 05 16:24:34 2009 GMT
@@ -76,9 +76,7 @@
 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);

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.440
retrieving revision 1.441
diff -u -r1.440 -r1.441
--- xdebug/xdebug.c:1.440 Sun Jan 04 20:34:08 2009 GMT
+++ xdebug/xdebug.c Mon Jan 05 16:24:34 2009 GMT
@@ -53,12 +53,8 @@
 #include "zend_compile.h"
 #include "zend_constants.h"
 #include "zend_extensions.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 "zend_exceptions.h"
+#include "zend_vm.h"
 
 #include "php_xdebug.h"
 #include "xdebug_private.h"
@@ -88,17 +84,8 @@
 
 static int xdebug_header_handler(sapi_header_struct *h, 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);
@@ -163,21 +150,13 @@
         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
 };
 
@@ -263,19 +242,10 @@
         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)
@@ -283,11 +253,7 @@
         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)
-#endif
         STD_PHP_INI_BOOLEAN("xdebug.overload_var_dump", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, overload_var_dump, zend_xdebug_globals, xdebug_globals)
         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)
@@ -319,30 +285,16 @@
         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_ENTRY("xdebug.remote_log", "", PHP_INI_ALL, OnUpdateString, remote_log, zend_xdebug_globals, xdebug_globals)
         PHP_INI_ENTRY("xdebug.idekey", "", PHP_INI_ALL, OnUpdateIDEKey)
-#if ZEND_EXTENSION_API_NO < 90000000
- STD_PHP_INI_ENTRY("xdebug.remote_cookie_expire_time", "3600", PHP_INI_ALL, OnUpdateInt, remote_cookie_expire_time, zend_xdebug_globals, xdebug_globals)
-#else
         STD_PHP_INI_ENTRY("xdebug.remote_cookie_expire_time", "3600", PHP_INI_ALL, OnUpdateLong, remote_cookie_expire_time, zend_xdebug_globals, xdebug_globals)
-#endif
 
         /* 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)
-#endif
 PHP_INI_END()
 
 static void php_xdebug_init_globals (zend_xdebug_globals *xg TSRMLS_DC)
@@ -468,10 +420,7 @@
         xdebug_arg_dtor(parts);
 }
 
-#ifdef ZEND_ENGINE_2
 /* Needed for code coverage as Zend doesn't always add EXT_STMT when expected */
-# 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);
 
@@ -493,30 +442,6 @@
         } \
         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; \
- int lineno; \
- char *file; \
-\
- cur_opcode = *EG(opline_ptr); \
- lineno = cur_opcode->lineno; \
-\
- file = op_array->filename; \
-\
- xdebug_count_line(file, lineno, 0, 0 TSRMLS_CC); \
- } \
- return old_##f##_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); \
-}
-#endif
 
 static int xdebug_common_assign_dim_handler(char *op, int do_cc, ZEND_OPCODE_HANDLER_ARGS)
 {
@@ -636,7 +561,6 @@
 XDEBUG_OPCODE_OVERRIDE(pre_inc_obj)
 XDEBUG_OPCODE_OVERRIDE(switch_free)
 XDEBUG_OPCODE_OVERRIDE(qm_assign)
-#endif
 
 
 PHP_MINIT_FUNCTION(xdebug)
@@ -669,7 +593,6 @@
         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);
 
@@ -727,7 +650,6 @@
         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);
-#endif
 
         if (zend_xdebug_initialised == 0) {
                 zend_error(E_WARNING, "Xdebug MUST be loaded as a Zend extension");
@@ -898,10 +820,7 @@
 
         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;
@@ -952,16 +871,10 @@
         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)));
@@ -1056,17 +969,6 @@
 
         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 */
@@ -1078,7 +980,6 @@
                         } 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) {
@@ -1213,10 +1114,6 @@
                         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) {
                         int is_var;
 
@@ -1224,7 +1121,6 @@
                 } else if (XG(collect_includes)) {
                         tmp->include_filename = xdstrdup(zend_get_executed_filename(TSRMLS_C));
                 }
-#endif
         } else {
                 if (edata->opline) {
                         cur_opcode = edata->opline;
@@ -1262,11 +1158,9 @@
                         }
 #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;
@@ -1278,7 +1172,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. */
@@ -1287,7 +1181,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) {
@@ -1306,7 +1200,6 @@
                                 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) {
@@ -1318,7 +1211,6 @@
                                         tmp->varc++;
                                 }
                         }
-# endif
                 }
         }
 
@@ -1388,17 +1280,14 @@
         }
 
         /* 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));
                 }
         }
-# endif
 
         /* opcode scanning time */
         while (i < j) {
-# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
                 char *cv = NULL;
                 int cv_len;
 
@@ -1410,24 +1299,6 @@
                         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++;
         }
 }
@@ -2428,7 +2299,6 @@
         }
 }
 
-#ifdef ZEND_ENGINE_2
 void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
 {
         zval *message, *file, *line;
@@ -2440,11 +2310,7 @@
                 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);
@@ -2488,23 +2354,16 @@
                 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();
 
@@ -2512,7 +2371,6 @@
 
         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));
@@ -2526,9 +2384,7 @@
         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);
@@ -2556,17 +2412,12 @@
                                  * 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 */
@@ -3006,23 +2857,13 @@
 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)
@@ -3304,31 +3145,18 @@
 
                 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;
 
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || (PHP_MAJOR_VERSION >= 6)
                 case IS_CV: {
                         zval **tmp;
                         tmp = zend_get_compiled_variable_value(zdata, node->u.constant.value.lval);
@@ -3337,7 +3165,6 @@
                         }
                         break;
                 }
-#endif
 
                 case IS_UNUSED:
                         fprintf(stderr, "\nIS_UNUSED\n");

[FILE: /xdebug/xdebug_code_coverage.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- xdebug/xdebug_code_coverage.c:1.45 Thu Dec 11 11:29:43 2008 GMT
+++ xdebug/xdebug_code_coverage.c Mon Jan 05 16:24:34 2009 GMT
@@ -89,11 +89,9 @@
                 opcode.opcode != ZEND_EXT_NOP &&
                 opcode.opcode != ZEND_RECV &&
                 opcode.opcode != ZEND_RECV_INIT
-#ifdef ZEND_ENGINE_2
                 && opcode.opcode != ZEND_VERIFY_ABSTRACT_CLASS
                 && opcode.opcode != ZEND_OP_DATA
                 && opcode.opcode != ZEND_ADD_INTERFACE
-#endif
         ) {
                 xdebug_count_line(fn, opcode.lineno, 1, deadcode TSRMLS_CC);
         }
@@ -119,11 +117,7 @@
 
         zend_op opcode = opa->opcodes[position];
         if (opcode.opcode == ZEND_JMP) {
-#ifdef ZEND_ENGINE_2
                 *jmp1 = ((long) opcode.op1.u.jmp_addr - (long) base_address) / sizeof(zend_op);
-#else
- *jmp1 = opcode.op1.u.opline_num;
-#endif
                 return 1;
         } else if (
                 opcode.opcode == ZEND_JMPZ ||
@@ -132,11 +126,7 @@
                 opcode.opcode == ZEND_JMPNZ_EX
         ) {
                 *jmp1 = position + 1;
-#ifdef ZEND_ENGINE_2
                 *jmp2 = ((long) opcode.op2.u.jmp_addr - (long) base_address) / sizeof(zend_op);
-#else
- *jmp2 = opcode.op1.u.opline_num;
-#endif
                 return 1;
         } else if (opcode.opcode == ZEND_JMPZNZ) {
                 *jmp1 = opcode.op2.u.opline_num;
@@ -146,11 +136,7 @@
                 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;
@@ -193,7 +179,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); */
@@ -210,7 +196,7 @@
                         }
                         position--;
                 }
-#endif
+
                 /* See if we have an exit instruction */
                 if (opa->opcodes[position].opcode == ZEND_EXIT) {
                         /* fprintf(stderr, "X* Return found\n"); */
@@ -238,7 +224,6 @@
 
         opa->reserved[XG(reserved_offset)] = 1;
 
-#ifdef ZEND_ENGINE_2
         /* Check for abstract methods and simply return from this function in those
          * cases. */
 #if PHP_VERSION_ID >= 50300
@@ -249,7 +234,6 @@
         {
                 return;
         }
-#endif
 
         /* Run dead code analysis if requested */
         if (XG(code_coverage_dead_code_analysis)) {
@@ -283,31 +267,19 @@
         return ZEND_HASH_APPLY_KEEP;
 }
 
-#ifdef ZEND_ENGINE_2
 static int prefill_from_class_table(zend_class_entry **class_entry, int num_args, va_list args, zend_hash_key *hash_key)
-#else
-static int prefill_from_class_table(zend_class_entry *class_entry, 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, (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;

[FILE: /xdebug/xdebug_compat.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- xdebug/xdebug_compat.c:1.11 Wed Apr 09 10:41:37 2008 GMT
+++ xdebug/xdebug_compat.c Mon Jan 05 16:24:34 2009 GMT
@@ -38,7 +38,7 @@
    | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
    +----------------------------------------------------------------------+
  */
-/* $Id: cvstemp,v 1.11 2008/04/09 12:41:37 derick Exp $ */
+/* $Id: cvstemp,v 1.12 2009/01/05 17:24:34 derick Exp $ */
 
 #include "php.h"
 #include "main/php_version.h"
@@ -46,249 +46,12 @@
 #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))
 
@@ -312,11 +75,7 @@
                                         || ((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];
@@ -336,75 +95,3 @@
         }
         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.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- xdebug/xdebug_compat.h:1.8 Tue Oct 09 20:28:34 2007 GMT
+++ xdebug/xdebug_compat.h Mon Jan 05 16:24:34 2009 GMT
@@ -21,30 +21,21 @@
 
 #include "php.h"
 
-#if ((PHP_MAJOR_VERSION == 4) && (PHP_MINOR_VERSION == 3) && (PHP_RELEASE_VERSION <= 1)) || PHP_MAJOR_VERSION >= 6
+#if 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
 
 
-#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
+#include "ext/standard/base64.h"
+#define xdebug_base64_encode php_base64_encode
+#define xdebug_base64_decode php_base64_decode
 
 zval *xdebug_zval_ptr(znode *node, temp_variable *Ts TSRMLS_DC);
 

[FILE: /xdebug/xdebug_handler_dbgp.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -r1.134 -r1.135
--- xdebug/xdebug_handler_dbgp.c:1.134 Tue May 27 10:40:06 2008 GMT
+++ xdebug/xdebug_handler_dbgp.c Mon Jan 05 16:24:34 2009 GMT
@@ -308,7 +308,7 @@
                 case XF_ST_ROOT:
                 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)) {
@@ -318,7 +318,7 @@
                                 }
                                 goto cleanup;
                         }
-#endif
+
                         if (ht && zend_hash_find(ht, element, name_length + 1, (void **) &retval_pp) == SUCCESS) {
                                 retval_p = *retval_pp;
                                 goto cleanup;
@@ -379,40 +379,28 @@
 
 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 PHP_MAJOR_VERSION == 4
- {
+
+ 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 = Z_OBJCE_P(z);
+
+ ce = zend_get_class_entry(z TSRMLS_CC);
+ if (!ce) {
+ return NULL;
+ }
+
                 *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;
+ *length = name_len;
+ return name;
 }
 
 static zval* get_symbol_contents_zval(char* name, int name_length TSRMLS_DC)
@@ -1164,7 +1152,6 @@
         } 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);
                 }
@@ -1174,9 +1161,6 @@
                 } 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) {
@@ -1880,10 +1864,8 @@
                         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;
@@ -2243,7 +2225,7 @@
 
 char *xdebug_dbgp_get_revision(void)
 {
- return "$Revision: 1.134 $";
+ return "$Revision: 1.135 $";
 }
 
 static int xdebug_dbgp_cmdloop(xdebug_con *context, int bail TSRMLS_DC)
@@ -2373,7 +2355,6 @@
         }
 
 /* {{{ 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);
@@ -2382,7 +2363,6 @@
         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);

[FILE: /xdebug/xdebug_handler_gdb.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- xdebug/xdebug_handler_gdb.c:1.88 Fri Jul 04 06:32:45 2008 GMT
+++ xdebug/xdebug_handler_gdb.c Mon Jan 05 16:24:34 2009 GMT
@@ -1353,7 +1353,7 @@
 
 char *xdebug_gdb_get_revision(void)
 {
- return "$Revision: 1.88 $";
+ return "$Revision: 1.89 $";
 }
 
 int xdebug_gdb_init(xdebug_con *context, int mode)
@@ -1376,7 +1376,6 @@
         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);
@@ -1384,7 +1383,6 @@
         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);

[FILE: /xdebug/xdebug_var.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- xdebug/xdebug_var.c:1.91 Tue Mar 04 10:23:52 2008 GMT
+++ xdebug/xdebug_var.c Mon Jan 05 16:24:34 2009 GMT
@@ -58,11 +58,9 @@
                 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");
@@ -104,7 +102,6 @@
 
 static char* xdebug_get_property_info(char *mangled_property, int mangled_len, char **property_name)
 {
-#ifdef ZEND_ENGINE_2
         char *prop_name, *class_name;
 
 #if PHP_VERSION_ID >= 50200
@@ -122,10 +119,6 @@
         } else {
                 return "public";
         }
-#else
- *property_name = mangled_property;
- return "var";
-#endif
 }
 
 
@@ -678,10 +671,8 @@
 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:
@@ -741,13 +732,9 @@
                         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);
                         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);
@@ -956,8 +943,7 @@
                                                 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", (level * 4) - 2, ""), 1);
- xdebug_str_add(str, xdebug_sprintf("...\n"), 1);
+ xdebug_str_add(str, xdebug_sprintf("%*s...\n", (level * 4) - 2, ""), 1);
                                 }
                         } else {
                                 xdebug_str_addl(str, "<i>&</i><b>array</b>\n", 21, 0);
@@ -969,11 +955,7 @@
                         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;
@@ -981,16 +963,11 @@
 
                                         zend_hash_apply_with_arguments(myht, (apply_func_args_t) xdebug_object_element_export_fancy, 4, level, str, debug_zval, options);
                                 } else {
- xdebug_str_add(str, xdebug_sprintf("%*s", (level * 4) - 2, ""), 1);
- xdebug_str_add(str, xdebug_sprintf("...\n"), 1);
+ xdebug_str_add(str, xdebug_sprintf("%*s...\n", (level * 4) - 2, ""), 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;
 
@@ -1068,9 +1045,7 @@
 
                 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;
 
Received on Mon Jan 05 2009 - 18:24:40 GMT

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