summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-29 00:16:00 +0000
committerMarcus Boerger <helly@php.net>2003-08-29 00:16:00 +0000
commitbdd2d4aacf053de59af24784cdcafd74fcb86d8b (patch)
tree70e813b4711c2d326fcaa83920fcdfbf6c0a175b /Zend/zend_builtin_functions.c
parentb3f3ddd1b56cc839f9c7ef5e96a3a8282851819e (diff)
downloadphp-git-bdd2d4aacf053de59af24784cdcafd74fcb86d8b.tar.gz
Need to tell zend_fetch_debug_backtrace() whether to skip top function or not.
# And i wondered why the trace wasn't rally accurate.
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 3c4bce4e76..8aa08d55e1 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1538,7 +1538,7 @@ ZEND_FUNCTION(debug_print_backtrace)
/* }}} */
-ZEND_API void zend_fetch_debug_backtrace(zval *return_value TSRMLS_DC)
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRMLS_DC)
{
zend_execute_data *ptr;
int lineno;
@@ -1568,10 +1568,12 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value TSRMLS_DC)
ptr = EG(current_execute_data);
- /* skip debug_backtrace() */
- ptr = ptr->prev_execute_data;
- cur_arg_pos -= 2;
- frames_on_stack--;
+ /* skip debug_backtrace() */
+ ptr = ptr->prev_execute_data;
+ if (skip_last) {
+ cur_arg_pos -= 2;
+ frames_on_stack--;
+ }
array_init(return_value);
@@ -1683,7 +1685,7 @@ ZEND_FUNCTION(debug_backtrace)
ZEND_WRONG_PARAM_COUNT();
}
- zend_fetch_debug_backtrace(return_value TSRMLS_CC);
+ zend_fetch_debug_backtrace(return_value, 1 TSRMLS_CC);
}
/* }}} */