summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2011-12-06 09:56:01 +0000
committerXinchen Hui <laruence@php.net>2011-12-06 09:56:01 +0000
commit17f5bf2ed957d7b3f10c9804f7d52ff85c84b43c (patch)
treee306c30ab1d898a48a567c2f4890d1337f98ec13 /.gdbinit
parent3f2bcb772361b372b5032cdfa0462570aa9bbf4f (diff)
downloadphp-git-17f5bf2ed957d7b3f10c9804f7d52ff85c84b43c.tar.gz
Add zbacktrace_ex to .gdbinit which will print extra argument info than zbacktrace
Implement FR #60448
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit73
1 files changed, 72 insertions, 1 deletions
diff --git a/.gdbinit b/.gdbinit
index 9d96331697..b8ca99b579 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -39,7 +39,62 @@ define dump_bt
while $t
printf "[0x%08x] ", $t
if $t->function_state.function->common.function_name
- printf "%s() ", $t->function_state.function->common.function_name
+ if !$__plain
+ if $t->function_state.arguments
+ set $count = (int)*($t->function_state.arguments)
+ printf "%s(", $t->function_state.function->common.function_name
+ while $count > 0
+ set $zvalue = *(zval **)($t->function_state.arguments - $count)
+ set $type = $zvalue->type
+ if $type == 0
+ printf "NULL"
+ end
+ if $type == 1
+ printf "%ld", $zvalue->value.lval
+ end
+ if $type == 2
+ printf "%lf", $zvalue->value.dval
+ end
+ if $type == 3
+ if $zvalue->value.lval
+ printf "true"
+ else
+ printf "false"
+ end
+ end
+ if $type == 4
+ printf "array(%d)[0x%08x]", $zvalue->value.ht->nNumOfElements, $zvalue
+ end
+ if $type == 5
+ printf "object[0x%08x]", $zvalue
+ end
+ if $type == 6
+ ____print_str $zvalue->value.str.val $zvalue->value.str.len
+ end
+ if $type == 7
+ printf "resource(#%d)", $zvalue->value.lval
+ end
+ if $type == 8
+ printf "constant"
+ end
+ if $type == 9
+ printf "const_array"
+ end
+ if $type > 9
+ printf "unknown type %d", $type
+ end
+ set $count = $count -1
+ if $count > 0
+ printf ", "
+ end
+ end
+ printf ") "
+ else
+ printf "%s() ", $t->function_state.function->common.function_name
+ end
+ else
+ printf "%s() ", $t->function_state.function->common.function_name
+ end
else
printf "??? "
end
@@ -480,6 +535,7 @@ end
define zbacktrace
____executor_globals
+ set $__plain = 1
dump_bt $eg.current_execute_data
end
@@ -490,6 +546,21 @@ document zbacktrace
> (gdb) dump_bt $eg.current_execute_data
end
+define zbacktrace_ex
+ ____executor_globals
+ set $__plain = 0
+ dump_bt $eg.current_execute_data
+ set $__plain = 1
+end
+
+document zbacktrace_ex
+ prints backtrace with arguments info
+ This command is almost a short cut for
+ > set $__plain = 0
+ > (gdb) ____executor_globals
+ > (gdb) dump_bt $eg.current_execute_data
+end
+
define zmemcheck
set $p = alloc_globals.head
set $stat = "?"