.gdbinit: refine rp [ci skip]
* .gdbinit (rp, output_string, rp): show the contents after NUL char. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1d36a09d81
commit
53a1b9f28f
31
.gdbinit
31
.gdbinit
@ -95,14 +95,15 @@ 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 print address off
|
set $len = ($rsflags & RUBY_FL_USER1) ? \
|
||||||
output (char *)(($rsflags & RUBY_FL_USER1) ? \
|
|
||||||
((struct RString*)$regsrc)->as.heap.ptr : \
|
|
||||||
((struct RString*)$regsrc)->as.ary)
|
|
||||||
set print address on
|
|
||||||
printf " len:%ld ", ($rsflags & RUBY_FL_USER1) ? \
|
|
||||||
((struct RString*)$regsrc)->as.heap.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)
|
(($rsflags & (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5|RUBY_FL_USER6)) >> RUBY_FL_USHIFT+2)
|
||||||
|
set print address off
|
||||||
|
output *(char *)(($rsflags & RUBY_FL_USER1) ? \
|
||||||
|
((struct RString*)$regsrc)->as.heap.ptr : \
|
||||||
|
((struct RString*)$regsrc)->as.ary) @ $len
|
||||||
|
set print address on
|
||||||
|
printf " len:%ld ", $len
|
||||||
if $flags & RUBY_FL_USER6
|
if $flags & RUBY_FL_USER6
|
||||||
printf "(none) "
|
printf "(none) "
|
||||||
end
|
end
|
||||||
@ -422,21 +423,17 @@ end
|
|||||||
|
|
||||||
define output_string
|
define output_string
|
||||||
set $flags = ((struct RBasic*)($arg0))->flags
|
set $flags = ((struct RBasic*)($arg0))->flags
|
||||||
printf "%s", (char *)(($flags & RUBY_FL_USER1) ? \
|
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)
|
||||||
|
output *(char *)(($flags & RUBY_FL_USER1) ? \
|
||||||
((struct RString*)($arg0))->as.heap.ptr : \
|
((struct RString*)($arg0))->as.heap.ptr : \
|
||||||
((struct RString*)($arg0))->as.ary)
|
((struct RString*)($arg0))->as.ary) @ $len
|
||||||
end
|
end
|
||||||
|
|
||||||
define rp_string
|
define rp_string
|
||||||
set $flags = ((struct RBasic*)($arg0))->flags
|
output_string $arg0
|
||||||
set print address off
|
printf " bytesize:%ld ", $len
|
||||||
output (char *)(($flags & RUBY_FL_USER1) ? \
|
|
||||||
((struct RString*)($arg0))->as.heap.ptr : \
|
|
||||||
((struct RString*)($arg0))->as.ary)
|
|
||||||
set print address on
|
|
||||||
printf " bytesize:%ld ", ($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)
|
if !($flags & RUBY_FL_USER1)
|
||||||
printf "(embed) "
|
printf "(embed) "
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user