lldb_rp: support Symbol [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c4e433a83a
commit
103a0b9869
@ -55,6 +55,9 @@ def fixnum_p(x):
|
|||||||
def flonum_p(x):
|
def flonum_p(x):
|
||||||
return (x&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
|
return (x&RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
|
||||||
|
|
||||||
|
def static_sym_p(x):
|
||||||
|
return (x&~(~0<<RUBY_SPECIAL_SHIFT)) == RUBY_SYMBOL_FLAG
|
||||||
|
|
||||||
def append_command_output(debugger, command, result):
|
def append_command_output(debugger, command, result):
|
||||||
output1 = result.GetOutput()
|
output1 = result.GetOutput()
|
||||||
debugger.GetCommandInterpreter().HandleCommand(command, result)
|
debugger.GetCommandInterpreter().HandleCommand(command, result)
|
||||||
@ -92,6 +95,11 @@ def lldb_rp(debugger, command, result, internal_dict):
|
|||||||
print >> result, num >> 1
|
print >> result, num >> 1
|
||||||
elif flonum_p(num):
|
elif flonum_p(num):
|
||||||
append_command_output(debugger, "print rb_float_value(%0#x)" % val.GetValueAsUnsigned(), result)
|
append_command_output(debugger, "print rb_float_value(%0#x)" % val.GetValueAsUnsigned(), result)
|
||||||
|
elif static_sym_p(num):
|
||||||
|
if num < 128:
|
||||||
|
print >> result, "T_SYMBOL: %c" % num
|
||||||
|
else:
|
||||||
|
print >> result, "T_SYMBOL: (%x)" % num
|
||||||
elif num & RUBY_IMMEDIATE_MASK:
|
elif num & RUBY_IMMEDIATE_MASK:
|
||||||
print >> result, 'immediate(%x)' % num
|
print >> result, 'immediate(%x)' % num
|
||||||
else:
|
else:
|
||||||
@ -120,6 +128,9 @@ def lldb_rp(debugger, command, result, internal_dict):
|
|||||||
print >> result, val.GetValueForExpressionPath("->as.heap")
|
print >> result, val.GetValueForExpressionPath("->as.heap")
|
||||||
else:
|
else:
|
||||||
print >> result, val.GetValueForExpressionPath("->as.ary")
|
print >> result, val.GetValueForExpressionPath("->as.ary")
|
||||||
|
elif flType == RUBY_T_SYMBOL:
|
||||||
|
tRSymbol = target.FindFirstType("struct RSymbol").GetPointerType()
|
||||||
|
print >> result, val.Cast(tRSymbol).Dereference()
|
||||||
elif flType == RUBY_T_ARRAY:
|
elif flType == RUBY_T_ARRAY:
|
||||||
tRArray = target.FindFirstType("struct RArray").GetPointerType()
|
tRArray = target.FindFirstType("struct RArray").GetPointerType()
|
||||||
val = val.Cast(tRArray)
|
val = val.Cast(tRArray)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user