diff options
author | Étienne Barrié <[email protected]> | 2025-04-10 15:26:06 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-04-15 11:50:48 +0900 |
commit | e1f544c1cf34787f139a973b934c9f535b201ea3 () | |
tree | aa19a9af18e8350bad61e9d4d7f06c8dd83063b4 /misc/lldb_cruby.py | |
parent | 6e184ebb5aa0461936a6db408a7fa48541a0e80d (diff) |
Always look for the top-level RBasic in LLDB scripts
`rp` and other commands were broken for me because they always showed the object as a T_NONE. The reason was that instead of returning the type `struct RBasic`, FindFirstType("struct RBasic") was returning `yjit::cruby::autogened::RBasic`. Explicitly asking for the top-level RBasic by prefixing it with `::` is enough to fix those commands.
Notes: Merged: https://.com/ruby/ruby/pull/13096
-rwxr-xr-x | misc/lldb_cruby.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -68,7 +68,7 @@ class BackTrace: return self.VM_FRAME_MAGIC_NAME.get(frame_type, "(none)") def rb_iseq_path_str(self, iseq): - tRBasic = self.target.FindFirstType("struct RBasic").GetPointerType() pathobj = iseq.GetValueForExpressionPath("->body->location.pathobj") pathobj = pathobj.Cast(tRBasic) @@ -270,7 +270,7 @@ def lldb_inspect(debugger, target, result, val): elif num & RUBY_IMMEDIATE_MASK: print('immediate(%x)' % num, file=result) else: - tRBasic = target.FindFirstType("struct RBasic").GetPointerType() val = val.Cast(tRBasic) flags = val.GetValueForExpressionPath("->flags").GetValueAsUnsigned() @@ -550,7 +550,7 @@ class HeapPageIter: self.num_slots = page.GetChildMemberWithName('total_slots').unsigned self.slot_size = page.GetChildMemberWithName('heap').GetChildMemberWithName('slot_size').unsigned self.counter = 0 - self.tRBasic = target.FindFirstType("struct RBasic") def is_valid(self): heap_page_header_size = self.target.FindFirstType("struct heap_page_header").GetByteSize() |