mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
.gdbinit: refine rp
* .gdbinit (rp): refine output of T_STRUCT and T_BIGNUM to show all elements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c56182a0b0
commit
49f38abe5e
1 changed files with 12 additions and 11 deletions
23
.gdbinit
23
.gdbinit
|
@ -157,28 +157,29 @@ define rp
|
||||||
print (struct RHash *)($arg0)
|
print (struct RHash *)($arg0)
|
||||||
else
|
else
|
||||||
if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT
|
if ($flags & RUBY_T_MASK) == RUBY_T_STRUCT
|
||||||
printf "%sT_STRUCT%s: len=%ld ", $color_type, $color_end, \
|
set $len = (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
|
||||||
(($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
|
|
||||||
($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
|
($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) >> (RUBY_FL_USHIFT+1) : \
|
||||||
((struct RStruct *)($arg0))->as.heap.len)
|
((struct RStruct *)($arg0))->as.heap.len)
|
||||||
|
printf "%sT_STRUCT%s: len=%ld ", $color_type, $color_end, $len
|
||||||
print (struct RStruct *)($arg0)
|
print (struct RStruct *)($arg0)
|
||||||
x/xw (($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
|
output/x *(($flags & (RUBY_FL_USER1|RUBY_FL_USER2)) ? \
|
||||||
((struct RStruct *)($arg0))->as.ary : \
|
((struct RStruct *)($arg0))->as.ary : \
|
||||||
((struct RStruct *)($arg0))->as.heap.ptr)
|
((struct RStruct *)($arg0))->as.heap.ptr) @ $len
|
||||||
else
|
else
|
||||||
if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM
|
if ($flags & RUBY_T_MASK) == RUBY_T_BIGNUM
|
||||||
printf "%sT_BIGNUM%s: sign=%d len=%ld ", $color_type, $color_end, \
|
set $len = (($flags & RUBY_FL_USER2) ? \
|
||||||
(($flags & RUBY_FL_USER1) != 0), \
|
|
||||||
(($flags & RUBY_FL_USER2) ? \
|
|
||||||
($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
|
($flags & (RUBY_FL_USER5|RUBY_FL_USER4|RUBY_FL_USER3)) >> (RUBY_FL_USHIFT+3) : \
|
||||||
((struct RBignum*)($arg0))->as.heap.len)
|
((struct RBignum*)($arg0))->as.heap.len)
|
||||||
|
printf "%sT_BIGNUM%s: sign=%d len=%ld ", $color_type, $color_end, \
|
||||||
|
(($flags & RUBY_FL_USER1) != 0), $len
|
||||||
if $flags & RUBY_FL_USER2
|
if $flags & RUBY_FL_USER2
|
||||||
printf "(embed) "
|
printf "(embed) "
|
||||||
end
|
end
|
||||||
print (struct RBignum *)($arg0)
|
print (struct RBignum *)($arg0)
|
||||||
x/xw (($flags & RUBY_FL_USER2) ? \
|
output/x *(($flags & RUBY_FL_USER2) ? \
|
||||||
((struct RBignum*)($arg0))->as.ary : \
|
((struct RBignum*)($arg0))->as.ary : \
|
||||||
((struct RBignum*)($arg0))->as.heap.digits)
|
((struct RBignum*)($arg0))->as.heap.digits) @ $len
|
||||||
|
printf "\n"
|
||||||
else
|
else
|
||||||
if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
|
if ($flags & RUBY_T_MASK) == RUBY_T_RATIONAL
|
||||||
printf "%sT_RATIONAL%s: ", $color_type, $color_end
|
printf "%sT_RATIONAL%s: ", $color_type, $color_end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue