.gdbinit: Update RString printing for new layout [ci skip]
This commit is contained in:
parent
c028bf0c7b
commit
8655cbec39
20
.gdbinit
20
.gdbinit
@ -83,13 +83,11 @@ define rp
|
|||||||
set $regsrc = ((struct RRegexp*)($arg0))->src
|
set $regsrc = ((struct RRegexp*)($arg0))->src
|
||||||
set $rsflags = ((struct RBasic*)$regsrc)->flags
|
set $rsflags = ((struct RBasic*)$regsrc)->flags
|
||||||
printf "%sT_REGEXP%s: ", $color_type, $color_end
|
printf "%sT_REGEXP%s: ", $color_type, $color_end
|
||||||
set $len = ($rsflags & RUBY_FL_USER1) ? \
|
set $len = ((struct RString*)($arg0))->len
|
||||||
((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 print address off
|
set print address off
|
||||||
output *(char *)(($rsflags & RUBY_FL_USER1) ? \
|
output *(char *)(($rsflags & RUBY_FL_USER1) ? \
|
||||||
((struct RString*)$regsrc)->as.heap.ptr : \
|
((struct RString*)$regsrc)->as.heap.ptr : \
|
||||||
((struct RString*)$regsrc)->as.ary) @ $len
|
((struct RString*)$regsrc)->as.embed.ary) @ $len
|
||||||
set print address on
|
set print address on
|
||||||
printf " len:%ld ", $len
|
printf " len:%ld ", $len
|
||||||
if $flags & RUBY_FL_USER6
|
if $flags & RUBY_FL_USER6
|
||||||
@ -424,13 +422,11 @@ end
|
|||||||
|
|
||||||
define output_string
|
define output_string
|
||||||
set $flags = ((struct RBasic*)($arg0))->flags
|
set $flags = ((struct RBasic*)($arg0))->flags
|
||||||
set $len = ($flags & RUBY_FL_USER1) ? \
|
set $len = ((struct RString*)($arg0))->len
|
||||||
((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 $len > 0
|
if $len > 0
|
||||||
output *(char *)(($flags & RUBY_FL_USER1) ? \
|
output *(char *)(($flags & RUBY_FL_USER1) ? \
|
||||||
((struct RString*)($arg0))->as.heap.ptr : \
|
((struct RString*)($arg0))->as.heap.ptr : \
|
||||||
((struct RString*)($arg0))->as.ary) @ $len
|
((struct RString*)($arg0))->as.embed.ary) @ $len
|
||||||
else
|
else
|
||||||
output ""
|
output ""
|
||||||
end
|
end
|
||||||
@ -438,13 +434,11 @@ end
|
|||||||
|
|
||||||
define print_string
|
define print_string
|
||||||
set $flags = ((struct RBasic*)($arg0))->flags
|
set $flags = ((struct RBasic*)($arg0))->flags
|
||||||
set $len = ($flags & RUBY_FL_USER1) ? \
|
set $len = ((struct RString*)($arg0))->len
|
||||||
((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 $len > 0
|
if $len > 0
|
||||||
printf "%s", *(char *)(($flags & RUBY_FL_USER1) ? \
|
printf "%s", *(char *)(($flags & RUBY_FL_USER1) ? \
|
||||||
((struct RString*)($arg0))->as.heap.ptr : \
|
((struct RString*)($arg0))->as.heap.ptr : \
|
||||||
((struct RString*)($arg0))->as.ary) @ $len
|
((struct RString*)($arg0))->as.embed.ary) @ $len
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1295,7 +1289,7 @@ define dump_node
|
|||||||
set $flags = ((struct RBasic*)($str))->flags
|
set $flags = ((struct RBasic*)($str))->flags
|
||||||
printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \
|
printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \
|
||||||
((struct RString*)$str)->as.heap.ptr : \
|
((struct RString*)$str)->as.heap.ptr : \
|
||||||
((struct RString*)$str)->as.ary)
|
((struct RString*)$str)->as.embed.ary)
|
||||||
end
|
end
|
||||||
|
|
||||||
define print_flags
|
define print_flags
|
||||||
|
Loading…
x
Reference in New Issue
Block a user