summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-02-26 17:26:16 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-02-26 17:26:16 +0100
commitd73789ef91ebd15f6b72529e78041d366f586611 (patch)
tree333733f6e422535d48725e1ed41b039c94945acc /.gdbinit
parentd303225c3a463cb0a7dabb51234adf684de13fa5 (diff)
downloadphp-git-d73789ef91ebd15f6b72529e78041d366f586611.tar.gz
Sync types in .gdbinit, improve property dumping
If an object doesn't have a property table, we need to go through the property into table and read the corresponding slots.
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit39
1 files changed, 25 insertions, 14 deletions
diff --git a/.gdbinit b/.gdbinit
index 56c11e4206..8e54830ef2 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -165,7 +165,7 @@ define ____printzv_contents
set $type = $zvalue->u1.v.type
# 15 == IS_INDIRECT
- if $type > 5 && $type != 15
+ if $type > 5 && $type < 12
printf "(refcount=%d) ", $zvalue->value.counted->gc.refcount
end
@@ -215,12 +215,8 @@ define ____printzv_contents
if ! $arg1
if $handlers->get_properties == &zend_std_get_properties
if $zobj->properties
+ printf "\nProperties "
set $ht = $zobj->properties
- else
- set $ht = &$zobj->ce->properties_info
- end
- printf "\nProperties "
- if $ht
set $ind = $ind + 1
____print_ht $ht 1
set $ind = $ind - 1
@@ -230,7 +226,19 @@ define ____printzv_contents
set $i = $i - 1
end
else
- echo "not found"
+ printf " {\n"
+ set $ht = &$zobj->ce->properties_info
+ set $k = 0
+ set $num = $ht->nNumUsed
+ while $k < $num
+ set $p = (Bucket*)($ht->arData + $k)
+ set $name = $p->key
+ set $prop = (zend_property_info*)$p->val.value.ptr
+ set $val = (zval*)((char*)$zobj + $prop->offset)
+ printf "%s => ", $name->val
+ printzv $val
+ set $k = $k + 1
+ end
end
end
end
@@ -250,17 +258,20 @@ define ____printzv_contents
printf "CONSTANT_AST"
end
if $type == 13
- printf "_BOOL"
+ printf "indirect: "
+ ____printzv $zvalue->value.zv $arg1
end
if $type == 14
- printf "CALLABLE"
+ printf "pointer: %p", $zvalue->value.ptr
end
if $type == 15
- printf "indirect: "
- ____printzv $zvalue->value.zv $arg1
+ printf "_ERROR"
+ end
+ if $type == 16
+ printf "_BOOL"
end
if $type == 17
- printf "pointer: %p", $zvalue->value.ptr
+ printf "CALLABLE"
end
if $type == 18
printf "ITERABLE"
@@ -269,9 +280,9 @@ define ____printzv_contents
printf "VOID"
end
if $type == 20
- printf "_ERROR"
+ printf "_NUMBER"
end
- if $type == 16 || $type > 20
+ if $type > 20
printf "unknown type %d", $type
end
printf "\n"