summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-01 14:48:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-01 14:48:54 +0000
commit6b4d78fc438afd5b89b49d8e32152f4a53deb4bc (patch)
tree3d5119b610f0fc8726ec28a7a52ec432063b5d14 /misc
parentb74f7fc3f211c490546f0724da34ee1d69dea89d (diff)
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
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/lldb_cruby.py9
1 files changed, 9 insertions, 0 deletions
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")