diff options
Diffstat (limited to 'misc/lldb_rb')
| -rw-r--r-- | misc/lldb_rb/commands/print_flags_command.py | 2 | ||||
| -rw-r--r-- | misc/lldb_rb/utils.py | 24 |
2 files changed, 15 insertions, 11 deletions
diff --git a/misc/lldb_rb/commands/print_flags_command.py b/misc/lldb_rb/commands/print_flags_command.py index 2b056dd098..bc494ae01a 100644 --- a/misc/lldb_rb/commands/print_flags_command.py +++ b/misc/lldb_rb/commands/print_flags_command.py @@ -17,7 +17,7 @@ class PrintFlagsCommand(RbBaseCommand): flags = [ "RUBY_FL_WB_PROTECTED", "RUBY_FL_PROMOTED", "RUBY_FL_FINALIZE", - "RUBY_FL_SHAREABLE", "RUBY_FL_EXIVAR", "RUBY_FL_FREEZE", + "RUBY_FL_SHAREABLE", "RUBY_FL_FREEZE", "RUBY_FL_USER0", "RUBY_FL_USER1", "RUBY_FL_USER2", "RUBY_FL_USER3", "RUBY_FL_USER4", "RUBY_FL_USER5", "RUBY_FL_USER6", "RUBY_FL_USER7", "RUBY_FL_USER8", "RUBY_FL_USER9", "RUBY_FL_USER10", "RUBY_FL_USER11", "RUBY_FL_USER12", "RUBY_FL_USER13", "RUBY_FL_USER14", 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"] |
