summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2012-09-30 20:31:36 -0700
committerStanislav Malyshev <stas@php.net>2012-09-30 20:31:36 -0700
commitc95fd5f758912c23e74ac90e6bf56002d4a5947a (patch)
tree2fd0d484e2e50fa1e64d37726426294efcab51fe /.gdbinit
parent40bb9254c59504af21a128355ea6892961291ace (diff)
parentdedbba4e5bab1e3520c9cc43b094a3a057b0316f (diff)
downloadphp-git-c95fd5f758912c23e74ac90e6bf56002d4a5947a.tar.gz
Merge branch 'pull-request/209' into PHP-5.4
* pull-request/209: Eliminate process running requirement of dump_bt in .gdbinit Add missing ____executor_globals in dump_bt if needed Implemented FR #63188 (Display class name when debugging with gdb macro zbacktrace)
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit57
1 files changed, 49 insertions, 8 deletions
diff --git a/.gdbinit b/.gdbinit
index 4a26d9608b..87c9425615 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -38,12 +38,53 @@ define dump_bt
set $t = $arg0
while $t
printf "[%p] ", $t
- if $t->function_state.function->common.function_name
- if $t->function_state.arguments
- set $count = (int)*($t->function_state.arguments)
- printf "%s(", $t->function_state.function->common.function_name
+ set $fst = $t->function_state
+ if $fst.function->common.function_name
+ if $fst.arguments
+ set $count = (int)*($fst.arguments)
+
+ if $t->object
+ if $fst.function.common.scope
+ printf "%s->", $fst.function.common.scope->name
+ else
+ if !$eg && !basic_functions_module.zts
+ ____executor_globals
+ end
+
+ 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 !$known_class
+ printf "Unknown->"
+ end
+ end
+ else
+ if $fst.function.common.scope
+ printf "%s::", $fst.function.common.scope->name
+ end
+ end
+
+ printf "%s(", $fst.function->common.function_name
while $count > 0
- set $zvalue = *(zval **)($t->function_state.arguments - $count)
+ set $zvalue = *(zval **)($fst.arguments - $count)
set $type = $zvalue->type
if $type == 0
printf "NULL"
@@ -73,7 +114,7 @@ define dump_bt
if $type == 7
printf "resource(#%d)", $zvalue->value.lval
end
- if $type == 8
+ if $type == 8
printf "constant"
end
if $type == 9
@@ -89,7 +130,7 @@ define dump_bt
end
printf ") "
else
- printf "%s() ", $t->function_state.function->common.function_name
+ printf "%s() ", $fst.function->common.function_name
end
else
printf "??? "
@@ -600,7 +641,7 @@ define zmemcheck
end
end
if $not_found
- printf "no such block that begins at %p.\n", $aptr
+ printf "no such block that begins at %p.\n", $aptr
end
if $arg0 == 0
printf "-------------------------------------------------------------------------------\n"