[前][次][番号順一覧][スレッド一覧]

ruby-changes:61910

From: Nobuyoshi <ko1@a...>
Date: Tue, 23 Jun 2020 15:59:10 +0900 (JST)
Subject: [ruby-changes:61910] 6aa3aaac05 (master): lldb_cruby.py: show the sign of Bignum [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=6aa3aaac05

From 6aa3aaac054619942762447bd60a5e26966305c2 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 23 Jun 2020 15:52:37 +0900
Subject: lldb_cruby.py: show the sign of Bignum [ci skip]


diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index fff8cc7..7391671 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -176,13 +176,14 @@ def lldb_inspect(debugger, target, result, val): https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L176
         elif flType == RUBY_T_BIGNUM:
             tRBignum = target.FindFirstType("struct RBignum").GetPointerType()
             val = val.Cast(tRBignum)
+            sign = '+' if (flags & RUBY_FL_USER1) != 0 else '-'
             if flags & RUBY_FL_USER2:
                 len = ((flags & (RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5)) >> (RUBY_FL_USHIFT+3))
-                print("T_BIGNUM: len=%d (embed)" % len, file=result)
+                print("T_BIGNUM: sign=%s len=%d (embed)" % (sign, len), file=result)
                 append_command_output(debugger, "print ((struct RBignum *) %0#x)->as.ary" % val.GetValueAsUnsigned(), result)
             else:
                 len = val.GetValueForExpressionPath("->as.heap.len").GetValueAsSigned()
-                print("T_BIGNUM: len=%d" % len, file=result)
+                print("T_BIGNUM: sign=%s len=%d" % (sign, len), file=result)
                 print(val.Dereference(), file=result)
                 append_command_output(debugger, "expression -Z %x -fx -- (const BDIGIT*)((struct RBignum*)%d)->as.heap.digits" % (len, val.GetValueAsUnsigned()), result)
                 # append_command_output(debugger, "x ((struct RBignum *) %0#x)->as.heap.digits / %d" % (val.GetValueAsUnsigned(), len), result)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]