summaryrefslogtreecommitdiff
path: root/misc/lldb_rb
diff options
context:
space:
mode:
Diffstat (limited to 'misc/lldb_rb')
-rw-r--r--misc/lldb_rb/utils.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/misc/lldb_rb/utils.py b/misc/lldb_rb/utils.py
index f4775bc4f9..a2bcedc328 100644
--- a/misc/lldb_rb/utils.py
+++ b/misc/lldb_rb/utils.py
@@ -236,16 +236,20 @@ class RbInspector(LLDBInterface):
elif rval.is_type("RUBY_T_DATA"):
tRTypedData = self.target.FindFirstType("struct RTypedData").GetPointerType()
val = val.Cast(tRTypedData)
- flag = val.GetValueForExpressionPath("->typed_flag")
- if flag.GetValueAsUnsigned() == 1:
- print("T_DATA: %s" %
- val.GetValueForExpressionPath("->type->wrap_struct_name"),
- file=self.result)
- self._append_expression("*(struct RTypedData *) %0#x" % val.GetValueAsUnsigned())
- else:
- print("T_DATA:", file=self.result)
- self._append_expression("*(struct RData *) %0#x" % val.GetValueAsUnsigned())
+ type = val.GetValueForExpressionPath("->type").GetValueAsUnsigned()
+ embed = (type & 1)
+ if embed:
+ flaginfo += "[EMBED] "
+ type = self.frame.EvaluateExpression("(rb_data_type_t *)%0#x" % (type & ~1))
+ print("T_DATA: %s%s" %
+ (flaginfo, type.GetValueForExpressionPath("->wrap_struct_name")),
+ file=self.result)
+ print("%s", type.Dereference(), file=self.result)
+ ptr = val.GetValueForExpressionPath("->data")
+ if embed:
+ ptr = ptr.AddressOf()
+ self._append_expression("(void *)%0#x" % ptr.GetValueAsUnsigned())
elif rval.is_type("RUBY_T_IMEMO"):
imemo_type = ((rval.flags >> self.ruby_globals["RUBY_FL_USHIFT"])
@@ -279,7 +283,7 @@ class RbInspector(LLDBInterface):
# if val.GetType() != tRNode: does not work for unknown reason
- if val.GetType().GetPointeeType().name != "NODE":
+ if val.GetType().GetPointeeType().GetCanonicalType().name != "RNode":
return False
rbNodeTypeMask = self.ruby_globals["RUBY_NODE_TYPEMASK"]