Browse files

fix PHP 5.5 build

  • Loading branch information...
1 parent 906787f commit 1dce3467e08e8bc10615d292ec1875ca16540dd0 @remicollet remicollet committed with Jan 3, 2013
Showing with 38 additions and 25 deletions.
  1. +2 −2 xdebug.c
  2. +14 −14 xdebug_code_coverage.c
  3. +6 −2 xdebug_compat.c
  4. +1 −1 xdebug_compat.h
  5. +8 −3 xdebug_handler_dbgp.c
  6. +6 −2 xdebug_var.c
  7. +1 −1 xdebug_var.h
View
4 xdebug.c
@@ -491,7 +491,7 @@ static int xdebug_include_or_eval_handler(ZEND_OPCODE_HANDLER_ARGS)
zval tmp_inc_filename;
int is_var;
- inc_filename = xdebug_get_zval(execute_data, opline->XDEBUG_TYPE(op1), &opline->op1, execute_data->Ts, &is_var);
+ inc_filename = xdebug_get_zval(execute_data, opline->XDEBUG_TYPE(op1), &opline->op1, &is_var);
/* If there is no inc_filename, we're just bailing out instead */
if (!inc_filename) {
@@ -1569,7 +1569,7 @@ void xdebug_execute_internal(zend_execute_data *current_execute_data, struct _ze
if (XG(collect_return) && do_return && XG(do_trace) && XG(trace_file) && EG(opline_ptr)) {
cur_opcode = *EG(opline_ptr);
if (cur_opcode) {
- zval *ret = xdebug_zval_ptr(cur_opcode->XDEBUG_TYPE(result), &(cur_opcode->result), current_execute_data->Ts TSRMLS_CC);
+ zval *ret = xdebug_zval_ptr(cur_opcode->XDEBUG_TYPE(result), &(cur_opcode->result), current_execute_data TSRMLS_CC);
if (ret) {
char* t = xdebug_return_trace_stack_retval(fse, ret TSRMLS_CC);
fprintf(XG(trace_file), "%s", t);
View
28 xdebug_code_coverage.c
@@ -110,27 +110,27 @@ static char *xdebug_find_var_name(zend_execute_data *execute_data TSRMLS_DC)
if (is_static) {
xdebug_str_add(&name, xdebug_sprintf("self::"), 1);
} else {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, prev_opcode->XDEBUG_TYPE(op1), &prev_opcode->op1, execute_data->Ts, &is_var), 0, options);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, prev_opcode->XDEBUG_TYPE(op1), &prev_opcode->op1, &is_var), 0, options);
xdebug_str_add(&name, xdebug_sprintf("$%s", zval_value), 1);
}
} else if (is_static) { /* todo : see if you can change this and the previous cases around */
xdebug_str_add(&name, xdebug_sprintf("self::"), 1 );
}
if (cur_opcode->opcode >= ZEND_ASSIGN_ADD && cur_opcode->opcode <= ZEND_ASSIGN_BW_XOR ) {
if (cur_opcode->extended_value == ZEND_ASSIGN_OBJ) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var), 0, options);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, &is_var), 0, options);
if (cur_opcode->XDEBUG_TYPE(op1) == IS_UNUSED) {
xdebug_str_add(&name, xdebug_sprintf("$this->%s", zval_value), 1);
} else {
xdebug_str_add(&name, xdebug_sprintf("->%s", zval_value), 1);
}
} else if (cur_opcode->extended_value == ZEND_ASSIGN_DIM) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var), 0, NULL);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, &is_var), 0, NULL);
xdebug_str_add(&name,xdebug_sprintf("[%s]", zval_value), 1);
}
}
if (cur_opcode->opcode >= ZEND_PRE_INC_OBJ && cur_opcode->opcode <= ZEND_POST_DEC_OBJ) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var), 0, options);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, &is_var), 0, options);
xdebug_str_add(&name, xdebug_sprintf("$this->%s", zval_value), 1);
}
if (zval_value) {
@@ -157,22 +157,22 @@ static char *xdebug_find_var_name(zend_execute_data *execute_data TSRMLS_DC)
xdebug_str_add(&name, xdebug_sprintf("$%s", zend_get_compiled_variable_name(op_array, opcode_ptr->XDEBUG_ZNODE_ELEM(op1, var), &cv_len)), 1);
}
if (opcode_ptr->opcode == ZEND_FETCH_W) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op1), &opcode_ptr->op1, execute_data->Ts, &is_var), 0, options);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op1), &opcode_ptr->op1, &is_var), 0, options);
xdebug_str_add(&name, xdebug_sprintf("%s", zval_value), 1);
}
if (is_static && opcode_ptr->opcode == ZEND_FETCH_RW) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op1), &opcode_ptr->op1, execute_data->Ts, &is_var), 0, options);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op1), &opcode_ptr->op1, &is_var), 0, options);
xdebug_str_add(&name, xdebug_sprintf("%s", zval_value), 1);
}
if (opcode_ptr->opcode == ZEND_FETCH_DIM_W) {
if (opcode_ptr->XDEBUG_TYPE(op2) != IS_VAR) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op2), &opcode_ptr->op2, execute_data->Ts, &is_var), 0, NULL);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op2), &opcode_ptr->op2, &is_var), 0, NULL);
xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1);
} else {
xdebug_str_add(&name, xdebug_sprintf("[???]") , 1);
}
} else if (opcode_ptr->opcode == ZEND_FETCH_OBJ_W) {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op2), &opcode_ptr->op2, execute_data->Ts, &is_var), 0, options);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op2), &opcode_ptr->op2, &is_var), 0, options);
xdebug_str_add(&name, xdebug_sprintf("->%s", zval_value), 1);
}
opcode_ptr = opcode_ptr + 1;
@@ -187,15 +187,15 @@ static char *xdebug_find_var_name(zend_execute_data *execute_data TSRMLS_DC)
if (cur_opcode->XDEBUG_TYPE(op1) == IS_UNUSED) {
xdebug_str_add(&name, "$this", 0);
}
- dimval = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var);
+ dimval = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, &is_var);
xdebug_str_add(&name, xdebug_sprintf("->%s", Z_STRVAL_P(dimval)), 1);
}
if (cur_opcode->opcode == ZEND_ASSIGN_DIM) {
if (next_opcode->opcode == ZEND_OP_DATA && cur_opcode->XDEBUG_TYPE(op2) == IS_UNUSED) {
xdebug_str_add(&name, "[]", 0);
} else {
- zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op2), &opcode_ptr->op2, execute_data->Ts, &is_var), 0, NULL);
+ zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->XDEBUG_TYPE(op2), &opcode_ptr->op2, &is_var), 0, NULL);
xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1);
xdfree(zval_value);
}
@@ -242,7 +242,7 @@ static int xdebug_common_assign_dim_handler(char *op, int do_cc, ZEND_OPCODE_HAN
xdfree(full_varname);
full_varname = tmp_varname;
- val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op1), &cur_opcode->op1, execute_data->Ts, &is_var);
+ val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op1), &cur_opcode->op1, &is_var);
} else if (cur_opcode->opcode >= ZEND_PRE_INC_OBJ && cur_opcode->opcode <= ZEND_POST_DEC_OBJ) {
char *tmp_varname;
@@ -255,11 +255,11 @@ static int xdebug_common_assign_dim_handler(char *op, int do_cc, ZEND_OPCODE_HAN
xdfree(full_varname);
full_varname = tmp_varname;
- val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var);
+ val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, &is_var);
} else if (next_opcode->opcode == ZEND_OP_DATA) {
- val = xdebug_get_zval(execute_data, next_opcode->XDEBUG_TYPE(op1), &next_opcode->op1, execute_data->Ts, &is_var);
+ val = xdebug_get_zval(execute_data, next_opcode->XDEBUG_TYPE(op1), &next_opcode->op1, &is_var);
} else {
- val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var);
+ val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, &is_var);
}
fse = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack)));
View
8 xdebug_compat.c 100755 → 100644
@@ -64,9 +64,13 @@ void *php_zend_memrchr(const void *s, int c, size_t n)
}
#endif
-#define T(offset) (*(temp_variable *)((char *) Ts + offset))
+#if defined(PHP_VERSION_ID) && PHP_VERSION_ID >= 50500
+#define T(offset) (*EX_TMP_VAR(zdata, offset))
+#else
+#define T(offset) (*(temp_variable *)((char*)zdata->Ts + offset))
+#endif
-zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC)
+zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, zend_execute_data *zdata TSRMLS_DC)
{
switch (op_type & 0x0F) {
case IS_CONST:
View
2 xdebug_compat.h 100755 → 100644
@@ -45,7 +45,7 @@ void *php_zend_memrchr(const void *s, int c, size_t n);
# define XDEBUG_PASS_TWO_DONE op_array->done_pass_two
#endif
-zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC);
+zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, zend_execute_data *zdata TSRMLS_DC);
#include "ext/standard/base64.h"
#define xdebug_base64_encode php_base64_encode
View
11 xdebug_handler_dbgp.c
@@ -394,15 +394,20 @@ static zval* fetch_zval_from_symbol_table(HashTable *ht, char* name, int name_le
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;
+ zval **CV;
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];
+#if defined(PHP_VERSION_ID) && PHP_VERSION_ID >= 50500
+ CV = (*EX_CV_NUM(XG(active_execute_data), i));
+#else
+ CV = XG(active_execute_data)->CVs[i];
+#endif
+ if (CV) {
+ retval_p = *CV;
goto cleanup;
}
}
View
8 xdebug_var.c
@@ -122,9 +122,13 @@ char* xdebug_error_type(int type)
}
/*************************************************************************************************************************************/
-#define T(offset) (*(temp_variable *)((char *) Ts + offset))
+#if defined(PHP_VERSION_ID) && PHP_VERSION_ID >= 50500
+#define T(offset) (*EX_TMP_VAR(zdata, offset))
+#else
+#define T(offset) (*(temp_variable *)((char*)zdata->Ts + offset))
+#endif
-zval *xdebug_get_zval(zend_execute_data *zdata, int node_type, XDEBUG_ZNODE *node, temp_variable *Ts, int *is_var)
+zval *xdebug_get_zval(zend_execute_data *zdata, int node_type, XDEBUG_ZNODE *node, int *is_var)
{
switch (node_type) {
case IS_CONST:
View
2 xdebug_var.h
@@ -64,7 +64,7 @@ void xdebug_var_export_xml_node(zval **struc, char *name, xdebug_xml_node *node,
char* xdebug_xmlize(char *string, int len, int *newlen);
char* xdebug_error_type_simple(int type);
char* xdebug_error_type(int type);
-zval *xdebug_get_zval(zend_execute_data *zdata, int node_type, XDEBUG_ZNODE *node, temp_variable *Ts, int *is_var);
+zval *xdebug_get_zval(zend_execute_data *zdata, int node_type, XDEBUG_ZNODE *node, int *is_var);
char* xdebug_get_zval_value(zval *val, int debug_zval, xdebug_var_export_options *options);
char* xdebug_get_zval_value_text_ansi(zval *val, int mode, int debug_zval, xdebug_var_export_options *options TSRMLS_DC);
#define xdebug_get_zval_value_text(v,d,o) xdebug_get_zval_value_text_ansi(v,0,d,o TSRMLS_CC);

0 comments on commit 1dce346

Please sign in to comment.