cvs: ZendEngine2 / zend_builtin_functions.c zend_builtin_functions.h zend_default_classes.c
| From: | Marcus Boerger | Date: | Fri, 29 Aug 2003 00:16:00 +0000 |
| Subject: | cvs: ZendEngine2 / zend_builtin_functions.c zend_builtin_functions.h zend_default_classes.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1734@lists.php.net to get a copy of this message | ||
helly Thu Aug 28 20:16:00 2003 EDT
Modified files:
/ZendEngine2 zend_builtin_functions.c zend_builtin_functions.h
zend_default_classes.c
Log:
Need to tell zend_fetch_debug_backtrace() whether to skip top function or not.
# And i wondered why the trace wasn't rally accurate.
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.208 ZendEngine2/zend_builtin_functions.c:1.209
--- ZendEngine2/zend_builtin_functions.c:1.208 Thu Aug 28 16:35:53 2003
+++ ZendEngine2/zend_builtin_functions.c Thu Aug 28 20:16:00 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.c,v 1.208 2003/08/28 20:35:53 helly Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.209 2003/08/29 00:16:00 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -1538,7 +1538,7 @@
/* }}} */
-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 @@
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_WRONG_PARAM_COUNT();
}
- zend_fetch_debug_backtrace(return_value TSRMLS_CC);
+ zend_fetch_debug_backtrace(return_value, 1 TSRMLS_CC);
}
/* }}} */
Index: ZendEngine2/zend_builtin_functions.h
diff -u ZendEngine2/zend_builtin_functions.h:1.13 ZendEngine2/zend_builtin_functions.h:1.14
--- ZendEngine2/zend_builtin_functions.h:1.13 Thu Aug 28 16:35:54 2003
+++ ZendEngine2/zend_builtin_functions.h Thu Aug 28 20:16:00 2003
@@ -17,13 +17,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_builtin_functions.h,v 1.13 2003/08/28 20:35:54 helly Exp $ */
+/* $Id: zend_builtin_functions.h,v 1.14 2003/08/29 00:16:00 helly Exp $ */
#ifndef ZEND_BUILTIN_FUNCTIONS_H
#define ZEND_BUILTIN_FUNCTIONS_H
int zend_startup_builtin_functions(TSRMLS_D);
-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);
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
Index: ZendEngine2/zend_default_classes.c
diff -u ZendEngine2/zend_default_classes.c:1.19 ZendEngine2/zend_default_classes.c:1.20
--- ZendEngine2/zend_default_classes.c:1.19 Thu Aug 28 19:43:56 2003
+++ ZendEngine2/zend_default_classes.c Thu Aug 28 20:16:00 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_default_classes.c,v 1.19 2003/08/28 23:43:56 helly Exp $ */
+/* $Id: zend_default_classes.c,v 1.20 2003/08/29 00:16:00 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
@@ -41,7 +41,7 @@
ALLOC_ZVAL(trace);
trace->is_ref = 0;
trace->refcount = 0;
- zend_fetch_debug_backtrace(trace TSRMLS_CC);
+ zend_fetch_debug_backtrace(trace, 0 TSRMLS_CC);
zend_update_property_string(class_type, &obj, "file", sizeof("file")-1,
zend_get_executed_filename(TSRMLS_C) TSRMLS_CC);
zend_update_property_long(class_type, &obj, "line", sizeof("line")-1,
zend_get_executed_lineno(TSRMLS_C) TSRMLS_CC);