summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-11-11 22:08:09 -0500
committerAlan Wu <[email protected]>2024-11-11 22:24:32 -0500
commit8655cbec3995d2890c40a9916566d5599080b2b1 (patch)
treea32b2e8bdbc1ddf102b17794cdbacc0c59ca5873
parentc028bf0c7b97584bd4d104375b3f12aa55c240f9 (diff)
.gdbinit: Update RString printing for new layout [ci skip]
-rw-r--r--.gdbinit20
1 files changed, 7 insertions, 13 deletions
diff --git a/.gdbinit b/.gdbinit
index 1c38ffe09c..df8ee35b22 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -83,13 +83,11 @@ define rp
set $regsrc = ((struct RRegexp*)($arg0))->src
set $rsflags = ((struct RBasic*)$regsrc)->flags
printf "%sT_REGEXP%s: ", $color_type, $color_end
- set $len = ($rsflags & RUBY_FL_USER1) ? \
- ((struct RString*)$regsrc)->as.heap.len : \
- (($rsflags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
+ set $len = ((struct RString*)($arg0))->len
set print address off
output *(char *)(($rsflags & RUBY_FL_USER1) ? \
((struct RString*)$regsrc)->as.heap.ptr : \
- ((struct RString*)$regsrc)->as.ary) @ $len
+ ((struct RString*)$regsrc)->as.embed.ary) @ $len
set print address on
printf " len:%ld ", $len
if $flags & RUBY_FL_USER6
@@ -424,13 +422,11 @@ end
define output_string
set $flags = ((struct RBasic*)($arg0))->flags
- set $len = ($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)
+ set $len = ((struct RString*)($arg0))->len
if $len > 0
output *(char *)(($flags & RUBY_FL_USER1) ? \
((struct RString*)($arg0))->as.heap.ptr : \
- ((struct RString*)($arg0))->as.ary) @ $len
+ ((struct RString*)($arg0))->as.embed.ary) @ $len
else
output ""
end
@@ -438,13 +434,11 @@ end
define print_string
set $flags = ((struct RBasic*)($arg0))->flags
- set $len = ($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)
+ set $len = ((struct RString*)($arg0))->len
if $len > 0
printf "%s", *(char *)(($flags & RUBY_FL_USER1) ? \
((struct RString*)($arg0))->as.heap.ptr : \
- ((struct RString*)($arg0))->as.ary) @ $len
+ ((struct RString*)($arg0))->as.embed.ary) @ $len
end
end
@@ -1295,7 +1289,7 @@ define dump_node
set $flags = ((struct RBasic*)($str))->flags
printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \
((struct RString*)$str)->as.heap.ptr : \
- ((struct RString*)$str)->as.ary)
+ ((struct RString*)$str)->as.embed.ary)
end
define print_flags