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
This commit is contained in:
nobu 2018-10-20 17:19:37 +00:00
Родитель 80220db346
Коммит 3a9c427908
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -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)