summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorMitch Hagstrand <mhagstrand@gmail.com>2018-02-09 11:30:45 -0600
committerNikita Popov <nikita.ppv@gmail.com>2018-02-10 19:18:39 +0100
commit01f7998db0ddf620233dbfe35d3344758876d78d (patch)
tree370d4b292ff930d878268dd31e288c160a28d20f /.gdbinit
parent5673c641dc30610e7e2fcca2e9b61761e4608ffc (diff)
downloadphp-git-01f7998db0ddf620233dbfe35d3344758876d78d.tar.gz
Enhancements and fixes for print_pi in gdbinit
1) Outputs the default value and the offset of a property 2) Fixed output of property flags
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit13
1 files changed, 11 insertions, 2 deletions
diff --git a/.gdbinit b/.gdbinit
index d60f214bf7..53ad8728a0 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -472,9 +472,12 @@ end
define print_pi
set $pi = (zend_property_info *)$arg0
+ set $initial_offset = ((uint32_t)(zend_uintptr_t)(&((zend_object*)0)->properties_table[(0)]))
+ set $ptr_to_val = (zval*)((char*)$pi->ce->default_properties_table + $pi->offset - $initial_offset)
printf "[%p] {\n", $pi
+ printf " offset = %p\n", $pi->offset
printf " ce = [%p] %s\n", $pi->ce, $pi->ce->name->val
- printf " flags = %d (", $pi->flags
+ printf " flags = 0x%x (", $pi->flags
if $pi->flags & 0x100
printf "ZEND_ACC_PUBLIC"
else
@@ -485,7 +488,11 @@ define print_pi
printf "ZEND_ACC_PRIVATE"
else
if $pi->flags & 0x800
- printf "ZEND_ACC_CHANGED"
+ printf "ZEND_ACC_EARLY_BINDING"
+ else
+ if $pi->flags & 0x20000
+ printf "ZEND_ACC_SHADOW"
+ end
end
end
end
@@ -493,6 +500,8 @@ define print_pi
printf ")\n"
printf " name = "
print_zstr $pi->name
+ printf " default value: "
+ printzv $ptr_to_val
printf "}\n"
end