From 6b4d78fc438afd5b89b49d8e32152f4a53deb4bc Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 1 Oct 2018 14:48:54 +0000 Subject: lldb_cruby.py: T_DATA support [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- misc/lldb_cruby.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'misc/lldb_cruby.py') diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py index e954d1be00..049f920bdb 100755 --- a/misc/lldb_cruby.py +++ b/misc/lldb_cruby.py @@ -130,6 +130,15 @@ def lldb_rp(debugger, command, result, internal_dict): else: debugger.HandleCommand("expression -Z %d -fx -- (const VALUE*)((struct RArray*)%d)->as.heap.ptr" % (len, val.GetValueAsUnsigned())) debugger.HandleCommand("p (struct RArray *) %0#x" % val.GetValueAsUnsigned()) + elif flType == RUBY_T_DATA: + tRTypedData = target.FindFirstType("struct RTypedData").GetPointerType() + val = val.Cast(tRTypedData) + flag = val.GetValueForExpressionPath("->typed_flag") + if flag.GetValueAsUnsigned() == 1: + debugger.HandleCommand("p *(rb_data_type_t *) %0#x" % val.GetValueForExpressionPath("->type").GetValueAsUnsigned()) + debugger.HandleCommand("p (void *) %0#x" % val.GetValueForExpressionPath("->data").GetValueAsUnsigned()) + else: + debugger.HandleCommand("p *(struct RData *) %0#x" % val.GetValueAsUnsigned()) def count_objects(debugger, command, ctx, result, internal_dict): objspace = ctx.frame.EvaluateExpression("ruby_current_vm->objspace") -- cgit v1.2.3