aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
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)