зеркало из https://github.com/github/ruby.git
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:
Родитель
80220db346
Коммит
3a9c427908
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче