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

ruby-changes:53040

From: nobu <ko1@a...>
Date: Sun, 21 Oct 2018 02:19:44 +0900 (JST)
Subject: [ruby-changes:53040] nobu:r65254 (trunk): lldb_cruby.py: T_COMPLEX support [ci skip]

nobu	2018-10-21 02:19:37 +0900 (Sun, 21 Oct 2018)

  New Revision: 65254

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65254

  Log:
    lldb_cruby.py: T_COMPLEX support [ci skip]

  Modified files:
    trunk/misc/lldb_cruby.py
Index: misc/lldb_cruby.py
===================================================================
--- misc/lldb_cruby.py	(revision 65253)
+++ misc/lldb_cruby.py	(revision 65254)
@@ -185,6 +185,18 @@ def lldb_inspect(debugger, target, resul https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L185
             result.Clear()
             result.write("(Rational) " + output.rstrip() + " / ")
             lldb_inspect(debugger, target, result, val.GetValueForExpressionPath("->den"))
+        elif flType == RUBY_T_COMPLEX:
+            tRComplex = target.FindFirstType("struct RComplex").GetPointerType()
+            val = val.Cast(tRComplex)
+            lldb_inspect(debugger, target, result, val.GetValueForExpressionPath("->real"))
+            real = result.GetOutput().rstrip()
+            result.Clear()
+            lldb_inspect(debugger, target, result, val.GetValueForExpressionPath("->imag"))
+            imag = result.GetOutput().rstrip()
+            result.Clear()
+            if not imag.startswith("-"):
+                imag = "+" + imag
+            print >> result, "(Complex) " + real + imag + "i"
         elif flType == RUBY_T_DATA:
             tRTypedData = target.FindFirstType("struct RTypedData").GetPointerType()
             val = val.Cast(tRTypedData)

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

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