/* }}} */
-ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRMLS_DC)
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int provide_object TSRMLS_DC)
{
zend_execute_data *ptr, *skip;
int lineno;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
add_assoc_text_ex(stack_frame, "class", sizeof("class"), class_name, dup);
}
+ if (provide_object) {
+ add_assoc_zval_ex(stack_frame, "object", sizeof("object"), ptr->object);
+ ptr->object->refcount++;
+ }
+
add_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
} else if (ptr->function_state.function->common.scope) {
add_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1);
ZEND_WRONG_PARAM_COUNT();
}
- zend_fetch_debug_backtrace(return_value, 1 TSRMLS_CC);
+ zend_fetch_debug_backtrace(return_value, 1, 1 TSRMLS_CC);
}
/* }}} */
int zend_startup_builtin_functions(TSRMLS_D);
BEGIN_EXTERN_C()
-ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRMLS_DC);
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int provide_object TSRMLS_DC);
END_EXTERN_C()
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
ALLOC_ZVAL(trace);
trace->is_ref = 0;
trace->refcount = 0;
- zend_fetch_debug_backtrace(trace, skip_top_traces TSRMLS_CC);
+ zend_fetch_debug_backtrace(trace, skip_top_traces, 0 TSRMLS_CC);
zend_update_property_rt_string(U_CLASS_ENTRY(default_exception_ce), &obj, "file", sizeof("file")-1, zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
zend_update_property_long(U_CLASS_ENTRY(default_exception_ce), &obj, "line", sizeof("line")-1, zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);