From 3a9c427908da692ae7e2f99cb1683d69885e347d Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 20 Oct 2018 17:19:37 +0000 Subject: 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 --- misc/lldb_cruby.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'misc') 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) -- cgit v1.2.3