Modified: xdebug/trunk/php_xdebug.h =================================================================== --- xdebug/trunk/php_xdebug.h 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/php_xdebug.h 2010-10-18 11:36:49 UTC (rev 3347) @@ -259,7 +259,9 @@ char *lasttransid; /* output redirection */ +#ifdef OUTPUTBUFFERING php_output_globals stdio; +#endif int stdout_redirected; int stderr_redirected; int stdin_redirected; Modified: xdebug/trunk/xdebug.c =================================================================== --- xdebug/trunk/xdebug.c 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug.c 2010-10-18 11:36:49 UTC (rev 3347) @@ -456,13 +456,17 @@ { zend_op *opline = execute_data->opline; +#if PHP_VERSION_ID >= 50399 + if (opline->extended_value == ZEND_EVAL) { +#else if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) { +#endif zval *inc_filename; zval tmp_inc_filename; int is_var; int tmp_len; - inc_filename = xdebug_get_zval(execute_data, &opline->op1, execute_data->Ts, &is_var); + inc_filename = xdebug_get_zval(execute_data, opline->op1_type, &opline->op1, execute_data->Ts, &is_var); /* If there is no inc_filename, we're just bailing out instead */ if (!inc_filename) { @@ -718,7 +722,7 @@ zend_function *orig; char *idekey; zval **dummy; - + /* get xdebug ini entries from the environment also */ XG(ide_key) = NULL; xdebug_env_config(); @@ -958,16 +962,16 @@ } /* opcode scanning time */ - while (i < op_array->size) { + while (i < op_array->last) { char *cv = NULL; int cv_len; - if (op_array->opcodes[i].op1.op_type == IS_CV) { - cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].op1.u.var, &cv_len); + if (op_array->opcodes[i].XDEBUG_TYPE(op1) == IS_CV) { + cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op1,var), &cv_len); xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv)); } - if (op_array->opcodes[i].op2.op_type == IS_CV) { - cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].op2.u.var, &cv_len); + if (op_array->opcodes[i].XDEBUG_TYPE(op2) == IS_CV) { + cv = zend_get_compiled_variable_name(op_array, op_array->opcodes[i].XDEBUG_ZNODE_ELEM(op2,var), &cv_len); xdebug_llist_insert_next(fse->used_vars, XDEBUG_LLIST_TAIL(fse->used_vars), xdstrdup(cv)); } i++; @@ -1370,11 +1374,13 @@ 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), current_execute_data->Ts TSRMLS_CC); - char* t = xdebug_return_trace_stack_retval(fse, ret TSRMLS_CC); - fprintf(XG(trace_file), "%s", t); - fflush(XG(trace_file)); - xdfree(t); + zval *ret = xdebug_zval_ptr(cur_opcode->result_type, &(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); + fflush(XG(trace_file)); + xdfree(t); + } } } @@ -1399,7 +1405,6 @@ return ZEND_USER_OPCODE_DISPATCH; } - /* {{{ zend_op_array srm_compile_file (file_handle, type) * This function provides a hook for the execution of bananas */ zend_op_array *xdebug_compile_file(zend_file_handle *file_handle, int type TSRMLS_DC) @@ -1409,7 +1414,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_PASS_TWO_DONE)) { xdebug_prefill_code_coverage(op_array TSRMLS_CC); } } Modified: xdebug/trunk/xdebug_code_coverage.c =================================================================== --- xdebug/trunk/xdebug_code_coverage.c 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_code_coverage.c 2010-10-18 11:36:49 UTC (rev 3347) @@ -83,26 +83,26 @@ next_opcode = cur_opcode + 1; prev_opcode = cur_opcode - 1; - if (cur_opcode->op1.op_type == IS_VAR && - (next_opcode->op1.op_type == IS_VAR || cur_opcode->op2.op_type == IS_VAR) && + if (cur_opcode->XDEBUG_TYPE(op1) == IS_VAR && + (next_opcode->XDEBUG_TYPE(op1) == IS_VAR || cur_opcode->XDEBUG_TYPE(op2) == IS_VAR) && prev_opcode->opcode == ZEND_FETCH_RW && - prev_opcode->op1.op_type == IS_CONST && - prev_opcode->op1.u.constant.type == IS_STRING + prev_opcode->XDEBUG_TYPE(op1) == IS_CONST && + Z_TYPE_P(prev_opcode->op1.zv) == IS_STRING ) { - xdebug_str_add(&name, xdebug_sprintf("$%s", prev_opcode->op1.u.constant.value.str.val), 1); + xdebug_str_add(&name, xdebug_sprintf("$%s", Z_STRVAL_P(prev_opcode->op1.zv)), 1); } - is_static = (prev_opcode->op1.op_type == IS_CONST && prev_opcode->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER); + is_static = (prev_opcode->XDEBUG_TYPE(op1) == IS_CONST && prev_opcode->XDEBUG_EXTENDED_VALUE(op2) == ZEND_FETCH_STATIC_MEMBER); options = xdebug_var_export_options_from_ini(TSRMLS_C); options->no_decoration = 1; - if (cur_opcode->op1.op_type == IS_CV) { - xdebug_str_add(&name, xdebug_sprintf("$%s", zend_get_compiled_variable_name(op_array, cur_opcode->op1.u.var, &cv_len)), 1); - } else if (cur_opcode->op1.op_type == IS_VAR && cur_opcode->opcode == ZEND_ASSIGN && prev_opcode->opcode == ZEND_FETCH_W) { + if (cur_opcode->XDEBUG_TYPE(op1) == IS_CV) { + xdebug_str_add(&name, xdebug_sprintf("$%s", zend_get_compiled_variable_name(op_array, cur_opcode->XDEBUG_ZNODE_ELEM(op1, var), &cv_len)), 1); + } else if (cur_opcode->XDEBUG_TYPE(op1) == IS_VAR && cur_opcode->opcode == ZEND_ASSIGN && prev_opcode->opcode == ZEND_FETCH_W) { 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, execute_data->Ts, &is_var), 0, options); + 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); 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 +110,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, execute_data->Ts, &is_var), 0, options); - if (cur_opcode->op1.op_type == IS_UNUSED) { + 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); + 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, execute_data->Ts, &is_var), 0, NULL); + 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); xdebug_str_add(&name,xdebug_sprintf("[%s]", zval_value), 1); } } @@ -138,21 +138,21 @@ if (gohungfound) { do { - if (opcode_ptr->op1.op_type == IS_UNUSED && opcode_ptr->opcode == ZEND_FETCH_OBJ_W) { + if (opcode_ptr->XDEBUG_TYPE(op1) == IS_UNUSED && opcode_ptr->opcode == ZEND_FETCH_OBJ_W) { xdebug_str_add(&name, "$this", 0); } - if (opcode_ptr->op1.op_type == IS_CV) { - xdebug_str_add(&name, xdebug_sprintf("$%s", zend_get_compiled_variable_name(op_array, opcode_ptr->op1.u.var, &cv_len)), 1); + if (opcode_ptr->XDEBUG_TYPE(op1) == IS_CV) { + 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, execute_data->Ts, &is_var), 0, options); + 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); 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, execute_data->Ts, &is_var), 0, NULL); + 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); 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, execute_data->Ts, &is_var), 0, options); + 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); xdebug_str_add(&name, xdebug_sprintf("->%s", zval_value), 1); } opcode_ptr = opcode_ptr + 1; @@ -164,18 +164,18 @@ } if (cur_opcode->opcode == ZEND_ASSIGN_OBJ) { - if (cur_opcode->op1.op_type == IS_UNUSED) { + if (cur_opcode->XDEBUG_TYPE(op1) == IS_UNUSED) { xdebug_str_add(&name, "$this", 0); } - dimval = xdebug_get_zval(execute_data, &cur_opcode->op2, execute_data->Ts, &is_var); + dimval = xdebug_get_zval(execute_data, cur_opcode->op2_type, &cur_opcode->op2, execute_data->Ts, &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->op2.op_type == IS_UNUSED) { + 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, execute_data->Ts, &is_var), 0, NULL); + 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); xdebug_str_add(&name, xdebug_sprintf("[%s]", zval_value), 1); xdfree(zval_value); } @@ -222,11 +222,11 @@ xdfree(full_varname); full_varname = tmp_varname; - val = xdebug_get_zval(execute_data, &cur_opcode->op1, execute_data->Ts, &is_var); + val = xdebug_get_zval(execute_data, cur_opcode->op1_type, &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, execute_data->Ts, &is_var); + val = xdebug_get_zval(execute_data, next_opcode->op1_type, &next_opcode->op1, execute_data->Ts, &is_var); } else { - val = xdebug_get_zval(execute_data, &cur_opcode->op2, execute_data->Ts, &is_var); + val = xdebug_get_zval(execute_data, cur_opcode->op2_type, &cur_opcode->op2, execute_data->Ts, &is_var); } fse = XDEBUG_LLIST_VALP(XDEBUG_LLIST_TAIL(XG(stack))); @@ -342,7 +342,7 @@ zend_op opcode = opa->opcodes[position]; if (opcode.opcode == ZEND_JMP) { - *jmp1 = ((long) opcode.op1.u.jmp_addr - (long) base_address) / sizeof(zend_op); + *jmp1 = ((long) opcode.XDEBUG_ZNODE_ELEM(op1, jmp_addr) - (long) base_address) / sizeof(zend_op); return 1; } else if ( opcode.opcode == ZEND_JMPZ || @@ -351,29 +351,29 @@ opcode.opcode == ZEND_JMPNZ_EX ) { *jmp1 = position + 1; - *jmp2 = ((long) opcode.op2.u.jmp_addr - (long) base_address) / sizeof(zend_op); + *jmp2 = ((long) opcode.XDEBUG_ZNODE_ELEM(op2, jmp_addr) - (long) base_address) / sizeof(zend_op); return 1; } else if (opcode.opcode == ZEND_JMPZNZ) { - *jmp1 = opcode.op2.u.opline_num; + *jmp1 = opcode.XDEBUG_ZNODE_ELEM(op2, opline_num); *jmp2 = opcode.extended_value; return 1; } else if (opcode.opcode == ZEND_BRK || opcode.opcode == ZEND_CONT) { zend_brk_cont_element *el; - if (opcode.op2.op_type == IS_CONST - && opcode.op1.u.jmp_addr != (zend_op*) 0xFFFFFFFF + if (opcode.XDEBUG_TYPE(op2) == IS_CONST + && opcode.XDEBUG_ZNODE_ELEM(op1, jmp_addr) != (zend_op*) 0xFFFFFFFF ) { - el = xdebug_find_brk_cont(&opcode.op2.u.constant, opcode.op1.u.opline_num, opa); + el = xdebug_find_brk_cont(opcode.op2.zv, opcode.XDEBUG_ZNODE_ELEM(op1, opline_num), opa); *jmp1 = opcode.opcode == ZEND_BRK ? el->brk : el->cont; return 1; } } else if (opcode.opcode == ZEND_FE_RESET || opcode.opcode == ZEND_FE_FETCH) { *jmp1 = position + 1; - *jmp2 = opcode.op2.u.opline_num; + *jmp2 = opcode.XDEBUG_ZNODE_ELEM(op2, opline_num); return 1; #if (PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) } else if (opcode.opcode == ZEND_GOTO) { - *jmp1 = ((long) opcode.op1.u.jmp_addr - (long) base_address) / sizeof(zend_op); + *jmp1 = ((long) opcode.XDEBUG_ZNODE_ELEM(op1, jmp_addr) - (long) base_address) / sizeof(zend_op); return 1; #endif } @@ -449,33 +449,33 @@ } } -static void prefill_from_oparray(char *fn, zend_op_array *opa TSRMLS_DC) +static void prefill_from_oparray(char *fn, zend_op_array *op_array TSRMLS_DC) { unsigned int i; xdebug_set *set = NULL; - opa->reserved[XG(reserved_offset)] = (void*) 1; + op_array->reserved[XG(reserved_offset)] = (void*) 1; /* Check for abstract methods and simply return from this function in those * cases. */ #if PHP_VERSION_ID >= 50300 - if (opa->last >= 3 && opa->opcodes[opa->last - 3].opcode == ZEND_RAISE_ABSTRACT_ERROR) + if (op_array->last >= 3 && op_array->opcodes[op_array->last - 3].opcode == ZEND_RAISE_ABSTRACT_ERROR) #else - if (opa->last >= 4 && opa->opcodes[opa->last - 4].opcode == ZEND_RAISE_ABSTRACT_ERROR) + if (op_array->last >= 4 && op_array->opcodes[op_array->last - 4].opcode == ZEND_RAISE_ABSTRACT_ERROR) #endif { return; } /* 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_oparray(opa, set TSRMLS_CC); + if (XG(code_coverage_dead_code_analysis) && XDEBUG_PASS_TWO_DONE) { + set = xdebug_set_create(op_array->last); + xdebug_analyse_oparray(op_array, set TSRMLS_CC); } /* The normal loop then finally */ - for (i = 0; i < opa->last; i++) { - zend_op opcode = opa->opcodes[i]; + for (i = 0; i < op_array->last; i++) { + zend_op opcode = op_array->opcodes[i]; prefill_from_opcode(fn, opcode, set ? !xdebug_set_in(set, i) : 0 TSRMLS_CC); } Modified: xdebug/trunk/xdebug_compat.c =================================================================== --- xdebug/trunk/xdebug_compat.c 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_compat.c 2010-10-18 11:36:49 UTC (rev 3347) @@ -73,20 +73,30 @@ #define T(offset) (*(temp_variable *)((char *) Ts + offset)) -zval *xdebug_zval_ptr(znode *node, temp_variable *Ts TSRMLS_DC) +#if PHP_VERSION_ID >= 50399 +zval *xdebug_zval_ptr(int op_type, XDEBUG_ZNODE *node, temp_variable *Ts TSRMLS_DC) { - switch (node->op_type) { +#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 + return node->zv; +#else return &node->u.constant; +#endif break; case IS_TMP_VAR: - return &T(node->u.var).tmp_var; + return &T(XDEBUG_ZNODEP_ELEM(node, var)).tmp_var; break; case IS_VAR: - if (T(node->u.var).var.ptr) { - return T(node->u.var).var.ptr; + if (T(XDEBUG_ZNODEP_ELEM(node, var)).var.ptr) { + return T(XDEBUG_ZNODEP_ELEM(node, var)).var.ptr; } else { - temp_variable *T = &T(node->u.var); + temp_variable *T = &T(XDEBUG_ZNODEP_ELEM(node, var)); zval *str = T->str_offset.str; if (T->str_offset.str->type != IS_STRING Modified: xdebug/trunk/xdebug_compat.h =================================================================== --- xdebug/trunk/xdebug_compat.h 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_compat.h 2010-10-18 11:36:49 UTC (rev 3347) @@ -33,12 +33,29 @@ void *php_zend_memrchr(const void *s, int c, size_t n); #endif +#if PHP_VERSION_ID >= 50399 +# define XDEBUG_ZNODE znode_op +# define XDEBUG_ZNODE_ELEM(node,var) node.var +# define XDEBUG_ZNODEP_ELEM(node,var) node->var +# 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 +# define XDEBUG_ZNODEP_ELEM(node,var) node->u.var +# 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 + #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); #if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) || (PHP_MAJOR_VERSION >= 6) # define XDEBUG_REFCOUNT refcount__gc Modified: xdebug/trunk/xdebug_handler_dbgp.c =================================================================== --- xdebug/trunk/xdebug_handler_dbgp.c 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_handler_dbgp.c 2010-10-18 11:36:49 UTC (rev 3347) @@ -155,10 +155,10 @@ DBGP_FUNC(stack_depth); DBGP_FUNC(stack_get); DBGP_FUNC(status); - +#if OUTPUTBUFFERING DBGP_FUNC(stderr); DBGP_FUNC(stdout); - +#endif DBGP_FUNC(stop); DBGP_FUNC(run); DBGP_FUNC(step_into); @@ -198,10 +198,10 @@ DBGP_FUNC_ENTRY(stack_depth, XDEBUG_DBGP_NONE) DBGP_FUNC_ENTRY(stack_get, XDEBUG_DBGP_NONE) DBGP_FUNC_ENTRY(status, XDEBUG_DBGP_POST_MORTEM) - +#if OUTPUTBUFFERING DBGP_FUNC_ENTRY(stderr, XDEBUG_DBGP_NONE) DBGP_FUNC_ENTRY(stdout, XDEBUG_DBGP_NONE) - +#endif DBGP_CONT_FUNC_ENTRY(run, XDEBUG_DBGP_NONE) DBGP_CONT_FUNC_ENTRY(step_into, XDEBUG_DBGP_NONE) DBGP_CONT_FUNC_ENTRY(step_out, XDEBUG_DBGP_NONE) @@ -1244,6 +1244,7 @@ return 0; } +#ifdef OUTPUTBUFFERING static int xdebug_header_write(const char *str, uint str_length TSRMLS_DC) { /* nesting_level is zero when final output is sent to sapi */ @@ -1319,8 +1320,8 @@ xdebug_xml_add_attribute_ex(*retval, "success", xdstrdup(success), 0, 1); } +#endif - DBGP_FUNC(stop) { XG(status) = DBGP_STATUS_STOPPED; @@ -2039,7 +2040,7 @@ } lines = xdebug_xml_node_init("xdebug:lines"); - for (i = 0; i < fse->op_array->size; i++ ) { + for (i = 0; i < fse->op_array->last; 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); @@ -2340,11 +2341,13 @@ XG(lastcmd) = NULL; XG(lasttransid) = NULL; +#if OUTPUT_BUFFERING XG(stdout_redirected) = 0; XG(stderr_redirected) = 0; XG(stdin_redirected) = 0; XG(stdio).php_body_write = NULL; XG(stdio).php_header_write = NULL; +#endif /* initialize remote log file */ XG(remote_log_file) = NULL; @@ -2455,6 +2458,7 @@ xdebug_dbgp_cmdloop(context, 0 TSRMLS_CC); } +#if OUTPUT_BUFFERING if (XG(stdio).php_body_write != NULL && OG(php_body_write)) { OG(php_body_write) = XG(stdio).php_body_write; OG(php_header_write) = XG(stdio).php_header_write; @@ -2462,7 +2466,7 @@ XG(stdio).php_body_write = NULL; XG(stdio).php_header_write = NULL; } - +#endif if (XG(remote_enabled)) { options = (xdebug_var_export_options*) context->options; xdfree(options->runtime); Modified: xdebug/trunk/xdebug_stack.c =================================================================== --- xdebug/trunk/xdebug_stack.c 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_stack.c 2010-10-18 11:36:49 UTC (rev 3347) @@ -774,7 +774,11 @@ } tmp->function = xdstrdup(edata->function_state.function->common.function_name); } else { +#if PHP_VERSION_ID >= 50399 + switch (edata->opline->extended_value) { +#else switch (edata->opline->op2.u.constant.value.lval) { +#endif case ZEND_EVAL: tmp->type = XFUNC_EVAL; break; Modified: xdebug/trunk/xdebug_var.c =================================================================== --- xdebug/trunk/xdebug_var.c 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_var.c 2010-10-18 11:36:49 UTC (rev 3347) @@ -75,22 +75,26 @@ /*************************************************************************************************************************************/ #define T(offset) (*(temp_variable *)((char *) Ts + offset)) -zval *xdebug_get_zval(zend_execute_data *zdata, znode *node, temp_variable *Ts, int *is_var) +zval *xdebug_get_zval(zend_execute_data *zdata, int node_type, XDEBUG_ZNODE *node, temp_variable *Ts, int *is_var) { - switch (node->op_type) { + switch (node_type) { case IS_CONST: +#if PHP_VERSION_ID >= 50399 + return node->zv; +#else return &node->u.constant; +#endif break; case IS_TMP_VAR: *is_var = 1; - return &T(node->u.var).tmp_var; + return &T(node->var).tmp_var; break; case IS_VAR: *is_var = 1; - if (T(node->u.var).var.ptr) { - return T(node->u.var).var.ptr; + if (T(node->var).var.ptr) { + return T(node->var).var.ptr; } else { fprintf(stderr, "\nIS_VAR\n"); } @@ -98,7 +102,7 @@ case IS_CV: { zval **tmp; - tmp = zend_get_compiled_variable_value(zdata, node->u.constant.value.lval); + tmp = zend_get_compiled_variable_value(zdata, node->constant); if (tmp) { return *tmp; } @@ -110,7 +114,7 @@ break; default: - fprintf(stderr, "\ndefault %d\n", node->op_type); + fprintf(stderr, "\ndefault %d\n", node_type); break; } Modified: xdebug/trunk/xdebug_var.h =================================================================== --- xdebug/trunk/xdebug_var.h 2010-10-18 11:35:17 UTC (rev 3346) +++ xdebug/trunk/xdebug_var.h 2010-10-18 11:36:49 UTC (rev 3347) @@ -20,6 +20,7 @@ #include "php_xdebug.h" #include "xdebug_str.h" #include "xdebug_xml.h" +#include "xdebug_compat.h" #include "xdebug_private.h" #ifndef __HAVE_XDEBUG_VAR_H__ @@ -57,7 +58,7 @@ char* xdebug_xmlize(char *string, int len, int *newlen); char* xdebug_error_type(int type); -zval *xdebug_get_zval(zend_execute_data *zdata, znode *node, temp_variable *Ts, int *is_var); +zval *xdebug_get_zval(zend_execute_data *zdata, int node_type, XDEBUG_ZNODE *node, temp_variable *Ts, int *is_var); char* xdebug_get_zval_value(zval *val, int debug_zval, xdebug_var_export_options *options); #ifndef PHP_WIN32 char* xdebug_get_zval_value_ansi(zval *val, int debug_zval, xdebug_var_export_options *options TSRMLS_DC);