summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorMitch Hagstrand <mhagstrand@gmail.com>2018-02-14 14:39:01 -0600
committerJoe Watkins <krakjoe@php.net>2018-02-15 08:57:32 +0100
commitda5db1c9b2125540d45fe581f6fd3c369e549985 (patch)
treec55564ff5cffaca94dbedbf88cc9ef1d9e427592 /.gdbinit
parent1f0ea7fa4d92b39e99a3061ade6bb65aaa8d7246 (diff)
downloadphp-git-da5db1c9b2125540d45fe581f6fd3c369e549985.tar.gz
Fixed print_const_table function and zval types in ____printzv_contents
1. Fixed print_const_table to work in ZE3 2. Removed ____print_const_table to use more generic ____print_ht 3. Fixed up zval types in ____printzv_contents
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit74
1 files changed, 32 insertions, 42 deletions
diff --git a/.gdbinit b/.gdbinit
index 53ad8728a0..5a2675d37e 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -171,7 +171,7 @@ define ____printzv_contents
printf "UNDEF"
end
if $type == 1
- printf "NULL"
+ printf "NULL"
end
if $type == 2
printf "bool: false"
@@ -179,15 +179,15 @@ define ____printzv_contents
if $type == 3
printf "bool: true"
end
- if $type == 4
+ if $type == 4
printf "long: %ld", $zvalue->value.lval
- end
- if $type == 5
- printf "double: %f", $zvalue->value.dval
- end
- if $type == 6
- printf "string: %s", $zvalue->value.str->val
- end
+ end
+ if $type == 5
+ printf "double: %f", $zvalue->value.dval
+ end
+ if $type == 6
+ printf "string: %s", $zvalue->value.str->val
+ end
if $type == 7
printf "array: "
if ! $arg1
@@ -245,25 +245,31 @@ define ____printzv_contents
printf "const: %s", $zvalue->value.str->val
end
if $type == 12
- printf "const_ast"
+ printf "CONSTANT_AST"
end
if $type == 13
- printf "_IS_BOOL"
+ printf "_BOOL"
end
if $type == 14
- printf "IS_CALLABLE"
+ printf "CALLABLE"
end
if $type == 15
printf "indirect: "
____printzv $zvalue->value.zv $arg1
end
- if $type == 16
- printf "string_offset"
- end
if $type == 17
printf "pointer: %p", $zvalue->value.ptr
end
- if $type > 17
+ if $type == 18
+ printf "ITERABLE"
+ end
+ if $type == 19
+ printf "VOID"
+ end
+ if $type == 20
+ printf "_ERROR"
+ end
+ if $type == 16 || $type > 20
printf "unknown type %d", $type
end
printf "\n"
@@ -283,38 +289,18 @@ define ____printzv
end
end
-define ____print_const_table
- set $ht = $arg0
- set $p = $ht->pListHead
-
- while $p != 0
- set $const = (zend_constant *) $p->pData
-
- set $i = $ind
- while $i > 0
- printf " "
- set $i = $i - 1
- end
-
- if $p->nKeyLength > 0
- ____print_str $p->arKey $p->nKeyLength
- printf " => "
- else
- printf "%d => ", $p->h
- end
-
- ____printzv_contents &$const->value 0
- set $p = $p->pListNext
- end
-end
-
define print_const_table
set $ind = 1
printf "[%p] {\n", $arg0
- ____print_const_table $arg0
+ ____print_ht $arg0 4
printf "}\n"
end
+document print_const_table
+ Dumps elements of Constants HashTable
+ Example: print_const_table executor_globals.zend_constants
+end
+
define ____print_ht
set $ht = (HashTable*)$arg0
set $n = $ind
@@ -361,6 +347,10 @@ define ____print_ht
set $func = (zend_function*)$p->val.value.ptr
printf "\"%s\"\n", $func->common.function_name->val
end
+ if $arg1 == 4
+ set $const = (zend_constant *)$p->val.value.ptr
+ ____printzv $const 1
+ end
end
set $i = $i + 1
end