Modified: xdebug/trunk/xdebug.c =================================================================== --- xdebug/trunk/xdebug.c 2010-10-18 11:36:49 UTC (rev 3347) +++ xdebug/trunk/xdebug.c 2010-10-22 17:27:09 UTC (rev 3348) @@ -466,7 +466,7 @@ int is_var; int tmp_len; - inc_filename = xdebug_get_zval(execute_data, opline->op1_type, &opline->op1, execute_data->Ts, &is_var); + inc_filename = xdebug_get_zval(execute_data, opline->XDEBUG_TYPE(op1), &opline->op1, execute_data->Ts, &is_var); /* If there is no inc_filename, we're just bailing out instead */ if (!inc_filename) { @@ -1374,7 +1374,7 @@ if (XG(collect_return) && do_return && XG(do_trace) && XG(trace_file)) { cur_opcode = *EG(opline_ptr); if (cur_opcode) { - zval *ret = xdebug_zval_ptr(cur_opcode->result_type, &(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->Ts TSRMLS_CC); if (ret) { char* t = xdebug_return_trace_stack_retval(fse, ret TSRMLS_CC); fprintf(XG(trace_file), "%s", t); Modified: xdebug/trunk/xdebug_code_coverage.c =================================================================== --- xdebug/trunk/xdebug_code_coverage.c 2010-10-18 11:36:49 UTC (rev 3347) +++ xdebug/trunk/xdebug_code_coverage.c 2010-10-22 17:27:09 UTC (rev 3348) @@ -87,9 +87,17 @@ (next_opcode->XDEBUG_TYPE(op1) == IS_VAR || cur_opcode->XDEBUG_TYPE(op2) == IS_VAR) && prev_opcode->opcode == ZEND_FETCH_RW && prev_opcode->XDEBUG_TYPE(op1) == IS_CONST && +#if PHP_VERSION_ID >= 50399 Z_TYPE_P(prev_opcode->op1.zv) == IS_STRING +#else + prev_opcode->op1.u.constant.type == IS_STRING +#endif ) { +#if PHP_VERSION_ID >= 50399 xdebug_str_add(&name, xdebug_sprintf("$%s", Z_STRVAL_P(prev_opcode->op1.zv)), 1); +#else + xdebug_str_add(&name, xdebug_sprintf("$%s", prev_opcode->op1.u.constant.value.str.val), 1); +#endif } is_static = (prev_opcode->XDEBUG_TYPE(op1) == IS_CONST && prev_opcode->XDEBUG_EXTENDED_VALUE(op2) == ZEND_FETCH_STATIC_MEMBER); @@ -102,7 +110,7 @@ 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->op1_type, &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, execute_data->Ts, &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 @@ -110,14 +118,14 @@ } 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->op2_type, &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, execute_data->Ts, &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->op2_type, &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, execute_data->Ts, &is_var), 0, NULL); xdebug_str_add(&name,xdebug_sprintf("[%s]", zval_value), 1); } } @@ -145,14 +153,14 @@ 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->op1_type, &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, execute_data->Ts, &is_var), 0, options); xdebug_str_add(&name, xdebug_sprintf("%s", zval_value), 1); } if (opcode_ptr->opcode == ZEND_FETCH_DIM_W) { - zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->op2_type, &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, execute_data->Ts, &is_var), 0, NULL); xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1); } else if (opcode_ptr->opcode == ZEND_FETCH_OBJ_W) { - zval_value = xdebug_get_zval_value(xdebug_get_zval(execute_data, opcode_ptr->op2_type, &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, execute_data->Ts, &is_var), 0, options); xdebug_str_add(&name, xdebug_sprintf("->%s", zval_value), 1); } opcode_ptr = opcode_ptr + 1; @@ -167,7 +175,7 @@ if (cur_opcode->XDEBUG_TYPE(op1) == IS_UNUSED) { xdebug_str_add(&name, "$this", 0); } - dimval = xdebug_get_zval(execute_data, cur_opcode->op2_type, &cur_opcode->op2, execute_data->Ts, &is_var); + dimval = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var); xdebug_str_add(&name, xdebug_sprintf("->%s", Z_STRVAL_P(dimval)), 1); } @@ -175,7 +183,7 @@ 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->op2_type, &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, execute_data->Ts, &is_var), 0, NULL); xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1); xdfree(zval_value); } @@ -222,11 +230,11 @@ xdfree(full_varname); full_varname = tmp_varname; - val = xdebug_get_zval(execute_data, cur_opcode->op1_type, &cur_opcode->op1, execute_data->Ts, &is_var); + val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op1), &cur_opcode->op1, execute_data->Ts, &is_var); } else if (next_opcode->opcode == ZEND_OP_DATA) { - val = xdebug_get_zval(execute_data, next_opcode->op1_type, &next_opcode->op1, execute_data->Ts, &is_var); + val = xdebug_get_zval(execute_data, next_opcode->XDEBUG_TYPE(op1), &next_opcode->op1, execute_data->Ts, &is_var); } else { - val = xdebug_get_zval(execute_data, cur_opcode->op2_type, &cur_opcode->op2, execute_data->Ts, &is_var); + val = xdebug_get_zval(execute_data, cur_opcode->XDEBUG_TYPE(op2), &cur_opcode->op2, execute_data->Ts, &is_var); } fse = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack))); @@ -363,7 +371,11 @@ if (opcode.XDEBUG_TYPE(op2) == IS_CONST && opcode.XDEBUG_ZNODE_ELEM(op1, jmp_addr) != (zend_op*) 0xFFFFFFFF ) { +#if PHP_VERSION_ID >= 50399 el = xdebug_find_brk_cont(opcode.op2.zv, opcode.XDEBUG_ZNODE_ELEM(op1, opline_num), opa); +#else + el = xdebug_find_brk_cont(&opcode.op2.u.constant, opcode.op1.u.opline_num, opa); +#endif *jmp1 = opcode.opcode == ZEND_BRK ? el->brk : el->cont; return 1; } Modified: xdebug/trunk/xdebug_compat.c =================================================================== --- xdebug/trunk/xdebug_compat.c 2010-10-18 11:36:49 UTC (rev 3347) +++ xdebug/trunk/xdebug_compat.c 2010-10-22 17:27:09 UTC (rev 3348) @@ -73,14 +73,8 @@ #define T(offset) (*(temp_variable *)((char *) Ts + offset)) -#if PHP_VERSION_ID >= 50399 zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC) { -#else -zval *xdebug_zval_ptr(XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC) -{ - int op_type = node->op_type; -#endif switch (op_type) { case IS_CONST: #if PHP_VERSION_ID >= 50399 Modified: xdebug/trunk/xdebug_compat.h =================================================================== --- xdebug/trunk/xdebug_compat.h 2010-10-18 11:36:49 UTC (rev 3347) +++ xdebug/trunk/xdebug_compat.h 2010-10-22 17:27:09 UTC (rev 3348) @@ -40,7 +40,6 @@ # define XDEBUG_TYPE(t) t##_type # define XDEBUG_EXTENDED_VALUE(o) extended_value # define XDEBUG_PASS_TWO_DONE (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) -zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC); #else # define XDEBUG_ZNODE znode # define XDEBUG_ZNODE_ELEM(node,var) node.u.var @@ -48,9 +47,9 @@ # define XDEBUG_TYPE(t) t.op_type # define XDEBUG_EXTENDED_VALUE(o) o.u.EA.type # define XDEBUG_PASS_TWO_DONE op_array->done_pass_two -zval *xdebug_zval_ptr(XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC); #endif +zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC); #include "ext/standard/base64.h" #define xdebug_base64_encode php_base64_encode Modified: xdebug/trunk/xdebug_var.c =================================================================== --- xdebug/trunk/xdebug_var.c 2010-10-18 11:36:49 UTC (rev 3347) +++ xdebug/trunk/xdebug_var.c 2010-10-22 17:27:09 UTC (rev 3348) @@ -88,13 +88,22 @@ case IS_TMP_VAR: *is_var = 1; +#if PHP_VERSION_ID >= 50399 return &T(node->var).tmp_var; +#else + return &T(node->u.var).tmp_var; +#endif break; case IS_VAR: *is_var = 1; +#if PHP_VERSION_ID >= 50399 if (T(node->var).var.ptr) { return T(node->var).var.ptr; +#else + if (T(node->u.var).var.ptr) { + return T(node->u.var).var.ptr; +#endif } else { fprintf(stderr, "\nIS_VAR\n"); } @@ -102,7 +111,11 @@ case IS_CV: { zval **tmp; +#if PHP_VERSION_ID >= 50399 tmp = zend_get_compiled_variable_value(zdata, node->constant); +#else + tmp = zend_get_compiled_variable_value(zdata, node->u.constant.value.lval); +#endif if (tmp) { return *tmp; }