summaryrefslogtreecommitdiff
path: root/Zend/zend_default_classes.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_default_classes.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_default_classes.c')
-rw-r--r--Zend/zend_default_classes.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c
index db0363e939..e99e6d3287 100644
--- a/Zend/zend_default_classes.c
+++ b/Zend/zend_default_classes.c
@@ -22,6 +22,7 @@
#include "zend.h"
#include "zend_API.h"
#include "zend_reflection_api.h"
+#include "zend_builtin_functions.h"
zend_class_entry *default_exception_ptr;
@@ -29,6 +30,7 @@ static zend_object_value zend_default_exception_new(zend_class_entry *class_type
{
zval tmp, obj;
zend_object *object;
+ zval *trace;
obj.value.obj = zend_objects_new(&object, class_type TSRMLS_CC);
@@ -36,8 +38,14 @@ static zend_object_value zend_default_exception_new(zend_class_entry *class_type
zend_hash_init(object->properties, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(object->properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ ALLOC_ZVAL(trace);
+ trace->is_ref = 0;
+ trace->refcount = 0;
+ zend_fetch_debug_backtrace(trace 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);
+ zend_update_property(class_type, &obj, "trace", sizeof("trace")-1, trace TSRMLS_CC);
return obj.value.obj;
}
@@ -128,6 +136,7 @@ static void zend_register_default_exception(TSRMLS_D)
zend_declare_property_long(default_exception_ptr, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED);
zend_declare_property_null(default_exception_ptr, "file", sizeof("file")-1, ZEND_ACC_PROTECTED);
zend_declare_property_null(default_exception_ptr, "line", sizeof("line")-1, ZEND_ACC_PROTECTED);
+ zend_declare_property_null(default_exception_ptr, "trace", sizeof("trace")-1, ZEND_ACC_PROTECTED);
}
ZEND_API zend_class_entry *zend_exception_get_default(void)