summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit14
1 files changed, 13 insertions, 1 deletions
diff --git a/.gdbinit b/.gdbinit
index f91ef63d06..66a4acbbe0 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -56,7 +56,19 @@ define rp
((struct RString*)$arg0)->as.heap.ptr : \
((struct RString*)$arg0)->as.ary)
set print address on
- printf " encoding:%d ", ($flags & (RUBY_FL_USER8|RUBY_FL_USER9|RUBY_FL_USER10|RUBY_FL_USER11)) >> RUBY_ENCODING_SHIFT
+ printf " bytesize:%d ", ($flags & RUBY_FL_USER1) ? \
+ ((struct RString*)$arg0)->as.heap.len : \
+ (($flags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
+ if !($flags & RUBY_FL_USER1)
+ printf "(embed) "
+ end
+ if ($flags & RUBY_FL_USER2)
+ printf "(shared) "
+ end
+ if ($flags & RUBY_FL_USER3)
+ printf "(assoc) "
+ end
+ printf "encoding:%d ", ($flags & (RUBY_FL_USER8|RUBY_FL_USER9|RUBY_FL_USER10|RUBY_FL_USER11)) >> RUBY_ENCODING_SHIFT
if ($flags & (RUBY_FL_USER12|RUBY_FL_USER13)) == 0
printf "coderange:unknown "
else