mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Fix RBignum print [ci skip]
This commit is contained in:
parent
9fa7ec9332
commit
ce717be188
2 changed files with 5 additions and 6 deletions
|
@ -132,11 +132,12 @@ class RbObject(LLDBInterface):
|
|||
return len
|
||||
|
||||
def bignum_len(self):
|
||||
if self.flags & flUser2:
|
||||
if self.flags & self.flUser2:
|
||||
len = ((self.flags &
|
||||
(self.flUser3 | self.flUser4 | self.flUser5)
|
||||
) >> (self.flUshift + 3))
|
||||
else:
|
||||
len = self.val.GetValueForExpressionPath("->as.heap.len")
|
||||
len = (self.as_type("bignum").GetValueForExpressionPath("->as.heap.len").
|
||||
GetValueAsUnsigned())
|
||||
|
||||
return len
|
||||
|
|
|
@ -175,8 +175,6 @@ class RbInspector(LLDBInterface):
|
|||
self._append_command_output("p *(struct RHash *) %0#x" % val.GetValueAsUnsigned())
|
||||
|
||||
elif rval.is_type("RUBY_T_BIGNUM"):
|
||||
tRBignum = self.target.FindFirstType("struct RBignum").GetPointerType()
|
||||
|
||||
sign = '-'
|
||||
if (rval.flags & self.ruby_globals["RUBY_FL_USER1"]) != 0:
|
||||
sign = '+'
|
||||
|
@ -188,9 +186,9 @@ class RbInspector(LLDBInterface):
|
|||
% val.GetValueAsUnsigned())
|
||||
else:
|
||||
print("T_BIGNUM: sign=%s len=%d" % (sign, len), file=self.result)
|
||||
print(val.Dereference(), file=self.result)
|
||||
print(rval.as_type("bignum"), file=self.result)
|
||||
self._append_command_output(
|
||||
"expression -Z %x -fx -- (const BDIGIT*)((struct RBignum*)%d)->as.heap.digits" %
|
||||
"expression -Z %d -fx -- ((struct RBignum*)%d)->as.heap.digits" %
|
||||
(len, val.GetValueAsUnsigned()))
|
||||
|
||||
elif rval.is_type("RUBY_T_FLOAT"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue