diff options
author | Matt Valentine-House <matt@eightbitraptor.com> | 2022-07-13 18:14:44 +0100 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2022-08-18 13:25:32 -0400 |
commit | b26aec9daa03a4f3da225e9e4f7a43e916928712 (patch) | |
tree | b2002f074b354f743f701b28d3c080d2ec70f5f8 /misc/lldb_rb/commands/rclass_ext_command.py | |
parent | a4ef2f16728b4b1eb49cc3aded26219cabdfa7e7 (diff) | |
download | ruby-b26aec9daa03a4f3da225e9e4f7a43e916928712.tar.gz |
[ci-skip][Feature #18910][lldb] New directory structure
Push the newly refactored lldb files into a sub-directory so that we're
not cluttering up the misc directory
Diffstat (limited to 'misc/lldb_rb/commands/rclass_ext_command.py')
-rw-r--r-- | misc/lldb_rb/commands/rclass_ext_command.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/misc/lldb_rb/commands/rclass_ext_command.py b/misc/lldb_rb/commands/rclass_ext_command.py new file mode 100644 index 0000000000..8bae911457 --- /dev/null +++ b/misc/lldb_rb/commands/rclass_ext_command.py @@ -0,0 +1,14 @@ +from lldb_rb.rb_base_command import RbBaseCommand + +class RclassExtCommand(RbBaseCommand): + program = "rclass_ext" + help_string = "retrieves and prints the rb_classext_struct for the VALUE pointer passed in" + + def call(self, debugger, command, exe_ctx, result): + uintptr_t = self.target.FindFirstType("uintptr_t") + rclass_t = self.target.FindFirstType("struct RClass") + rclass_ext_t = self.target.FindFirstType("rb_classext_t") + + rclass_addr = self.target.EvaluateExpression(command).Cast(uintptr_t) + rclass_ext_addr = (rclass_addr.GetValueAsUnsigned() + rclass_t.GetByteSize()) + debugger.HandleCommand("p *(rb_classext_t *)%0#x" % rclass_ext_addr) |