summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-28 20:35:54 +0000
committerMarcus Boerger <helly@php.net>2003-08-28 20:35:54 +0000
commit8d3620aea8beb6697b47173500a31f7bf3b6bc21 (patch)
tree5dd317dc833d51d11ea471f3a96d0a7bceab2900 /Zend/zend_builtin_functions.c
parent9d9727aac55b3f395402b57b49907d60abef59fa (diff)
downloadphp-git-8d3620aea8beb6697b47173500a31f7bf3b6bc21.tar.gz
- Split debug_backtrace() into lowlevel c function and php function wrapper
- Add trace property to default method based on new zend_fetch_debug_backtrace # Unforunatley the handler for uncaught exception can't show this backtrace # simply because there is currently no way to do it. If i can think of a # solution i'll add it. Until them i am open to any ideas/help.
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index c0786f8ff3..3c4bce4e76 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1537,9 +1537,8 @@ ZEND_FUNCTION(debug_print_backtrace)
}
/* }}} */
-/* {{{ proto void debug_backtrace(void)
- Prints out a backtrace */
-ZEND_FUNCTION(debug_backtrace)
+
+ZEND_API void zend_fetch_debug_backtrace(zval *return_value TSRMLS_DC)
{
zend_execute_data *ptr;
int lineno;
@@ -1554,10 +1553,6 @@ ZEND_FUNCTION(debug_backtrace)
int arg_stack_consistent = 0;
int frames_on_stack = 0;
- if (ZEND_NUM_ARGS()) {
- ZEND_WRONG_PARAM_COUNT();
- }
-
while (--args >= EG(argument_stack).elements) {
if (*args--) {
break;
@@ -1680,6 +1675,18 @@ ZEND_FUNCTION(debug_backtrace)
/* }}} */
+/* {{{ proto array debug_backtrace(void)
+ Return backtrace as array */
+ZEND_FUNCTION(debug_backtrace)
+{
+ if (ZEND_NUM_ARGS()) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ zend_fetch_debug_backtrace(return_value TSRMLS_CC);
+}
+/* }}} */
+
/* {{{ proto bool extension_loaded(string extension_name)
Returns true if the named extension is loaded */
ZEND_FUNCTION(extension_loaded)