ruby-changes:52691
From: nobu <ko1@a...>
Date: Wed, 3 Oct 2018 13:27:24 +0900 (JST)
Subject: [ruby-changes:52691] nobu:r64903 (trunk): lldb_rp: support more types [ci skip]
nobu 2018-10-03 13:27:19 +0900 (Wed, 03 Oct 2018) New Revision: 64903 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64903 Log: lldb_rp: support more types [ci skip] Modified files: trunk/misc/lldb_cruby.py Index: misc/lldb_cruby.py =================================================================== --- misc/lldb_cruby.py (revision 64902) +++ misc/lldb_cruby.py (revision 64903) @@ -140,6 +140,25 @@ def lldb_rp(debugger, command, result, i https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L140 else: result.write("\n") append_command_output(debugger, "expression -Z %d -fx -- (const VALUE*)%0#x" % (len, ptr.GetValueAsUnsigned()), result) + elif flType == RUBY_T_HASH: + debugger.HandleCommand("p *(struct RHash *) %0#x" % val.GetValueAsUnsigned()) + elif flType == RUBY_T_BIGNUM: + tRBignum = target.FindFirstType("struct RBignum").GetPointerType() + val = val.Cast(tRBignum) + if flags & RUBY_FL_USER2: + len = ((flags & (RUBY_FL_USER3|RUBY_FL_USER4|RUBY_FL_USER5)) >> (RUBY_FL_USHIFT+3)) + print >> result, "T_BIGNUM: len=%d (embed)" % len + append_command_output(debugger, "print ((struct RBignum *) %0#x)->as.ary" % val.GetValueAsUnsigned(), result) + else: + len = val.GetValueForExpressionPath("->as.heap.len").GetValueAsSigned() + print >> result, "T_BIGNUM: len=%d" % len + print >> result, val.Dereference() + append_command_output(debugger, "expression -Z %x -fx -- (const BDIGIT*)((struct RBignum*)%d)->as.heap.digits" % (len, val.GetValueAsUnsigned()), result) + # append_command_output(debugger, "x ((struct RBignum *) %0#x)->as.heap.digits / %d" % (val.GetValueAsUnsigned(), len), result) + elif flType == RUBY_T_FLOAT: + tRFloat = target.FindFirstType("struct RFloat").GetPointerType() + val = val.Cast(tRFloat) + debugger.HandleCommand("p *(double *)%0#x" % val.GetValueForExpressionPath("->float_value").GetAddress()) elif flType == RUBY_T_DATA: tRTypedData = target.FindFirstType("struct RTypedData").GetPointerType() val = val.Cast(tRTypedData) @@ -150,6 +169,9 @@ def lldb_rp(debugger, command, result, i https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L169 else: print >> result, "T_DATA:" append_command_output(debugger, "p *(struct RData *) %0#x" % val.GetValueAsUnsigned(), result) + else: + print >> result, "Not-handled type %0#x" % flType + print >> result, val def count_objects(debugger, command, ctx, result, internal_dict): objspace = ctx.frame.EvaluateExpression("ruby_current_vm->objspace") -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/