aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 17:19:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 17:19:37 +0000
commit3a9c427908da692ae7e2f99cb1683d69885e347d (patch)
treee08f1284db9143a9e7aeeae0f2b00dc6f1bce699 /misc
parent80220db346801040387558d9b9b85f1c73dcde3b (diff)
downloadruby-3a9c427908da692ae7e2f99cb1683d69885e347d.tar.gz
lldb_cruby.py: T_COMPLEX support [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index c9bb5cac7b..0c4b9fc0d1 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -185,6 +185,18 @@ def lldb_inspect(debugger, target, result, val):
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)