com php-src: Eliminate process running requirement of dump_bt in .gdbinit: .gdbinit
| From: | Stanislav Malyshev | Date: | Sun, 30 Sep 2012 19:10:15 +0000 |
| Subject: | com php-src: Eliminate process running requirement of dump_bt in .gdbinit: .gdbinit | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70290@lists.php.net to get a copy of this message | ||
Commit: dedbba4e5bab1e3520c9cc43b094a3a057b0316f
Author: Reeze Xia <reeze@php.net> Mon, 1 Oct 2012 03:10:15 +0800
Parents: 752280d4d2da31f9a761c53709f15f8d89fb81eb
Branches: PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=dedbba4e5bab1e3520c9cc43b094a3a057b0316f
Log:
Eliminate process running requirement of dump_bt in .gdbinit
Most of the time scope are avaible, but if not, it will be hard to get them,
since we can't call function if no proccess running. try to get class name
if we can.
Changed paths:
M .gdbinit
Diff:
diff --git a/.gdbinit b/.gdbinit
index 8cdfaa6..be2f007 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -47,23 +47,34 @@ define dump_bt
if $fst.function.common.scope
printf "%s->", $fst.function.common.scope->name
else
- ____executor_globals
- set $class_name_ptr = (char **)malloc(sizeof(char **))
- set $class_name_len = (int *)malloc(sizeof(int *))
-
- if basic_functions_module.zts
- set $dup = zend_get_object_classname($t->object, $class_name_ptr, $class_name_len,
$tsrm_ls)
- else
- set $dup = zend_get_object_classname($t->object, $class_name_ptr, $class_name_len)
+ if !$eg && !basic_functions_module.zts
+ ____executor_globals
end
- printf "%s->", *$class_name_ptr
+ set $known_class = 0
+ if $eg
+ set $handle = $t->object.value.obj.handle
+ set $handlers = $t->object.value.obj.handlers
+ set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
+
+ if $handlers->get_class_entry == &zend_std_object_get_class
+ set $known_class = 1
+
+ if $handlers.get_class_name
+ if $handlers.get_class_name != &zend_std_object_get_class_name
+ set $known_class = 0
+ end
+ end
+
+ if $known_class
+ printf "%s->", $zobj->ce.name
+ end
+ end
+ end
- if !$dup
- call _efree(*$class_name_ptr, "[GDB]", 0, "", 0)
+ if !$known_class
+ printf "Unknow->"
end
- call (void) free($class_name_ptr)
- call (void) free($class_name_len)
end
else
if $fst.function.common.scope