diff options
author | Matt Valentine-House <[email protected]> | 2023-03-16 09:54:36 +0000 |
---|---|---|
committer | Matt Valentine-House <[email protected]> | 2023-03-17 20:04:43 +0000 |
commit | c7862c68ebc44e6146f9b10f329eccdb9e5ef5fc () | |
tree | 008680d617ceb61b3f200614cedcad7cb664c485 /misc | |
parent | cc68d692f80bde4336bbefa2c0872f2a63064edb (diff) |
[ci skip] Move rp helper to new LLDB format
For now, the old function still exists as `old_rp`, in order to debug issues with this command.
Notes: Merged: https://.com/ruby/ruby/pull/7531
-rwxr-xr-x | misc/lldb_cruby.py | 4 | ||||
-rw-r--r-- | misc/lldb_rb/commands/rp_command.py | 16 | ||||
-rw-r--r-- | misc/lldb_rb/constants.py | 2 | ||||
-rw-r--r-- | misc/lldb_rb/lldb_interface.py | 8 | ||||
-rw-r--r-- | misc/lldb_rb/rb_base_command.py | 17 | ||||
-rw-r--r-- | misc/lldb_rb/rb_heap_structs.py | 140 | ||||
-rw-r--r-- | misc/lldb_rb/utils.py | 284 |
7 files changed, 455 insertions, 16 deletions
@@ -727,13 +727,13 @@ def __lldb_init_module(debugger, internal_dict): # Register all classes that subclass RbBaseCommand for memname, mem in inspect.getmembers(sys.modules["lldb_rb.rb_base_command"]): - if inspect.isclass(mem): for sclass in mem.__subclasses__(): sclass.register_lldb_command(debugger, f"{__name__}.{sclass.__module__}") ## FUNCTION INITS - These should be removed when converted to class commands - debugger.HandleCommand("command script add -f lldb_cruby.lldb_rp rp") debugger.HandleCommand("command script add -f lldb_cruby.count_objects rb_count_objects") debugger.HandleCommand("command script add -f lldb_cruby.stack_dump_raw SDR") debugger.HandleCommand("command script add -f lldb_cruby.dump_node dump_node") @@ -0,0 +1,16 @@ @@ -2,3 +2,5 @@ HEAP_PAGE_ALIGN_LOG = 16 HEAP_PAGE_ALIGN_MASK = (~(~0 << HEAP_PAGE_ALIGN_LOG)) HEAP_PAGE_ALIGN = (1 << HEAP_PAGE_ALIGN_LOG) HEAP_PAGE_SIZE = HEAP_PAGE_ALIGN @@ -0,0 +1,8 @@ @@ -1,7 +1,9 @@ import lldb from pydoc import locate -class RbBaseCommand: @classmethod def register_lldb_command(cls, debugger, module_name): # Add any commands contained in this module to LLDB @@ -53,16 +55,3 @@ class RbBaseCommand: def get_long_help(self): return self.__class__.help_string - def build_environment(self, debugger): - self.target = debugger.GetSelectedTarget() - self.process = self.target.GetProcess() - self.thread = self.process.GetSelectedThread() - self.frame = self.thread.GetSelectedFrame() - - def _append_command_output(self, debugger, command, result): - output1 = result.GetOutput() - debugger.GetCommandInterpreter().HandleCommand(command, result) - output2 = result.GetOutput() - result.Clear() - result.write(output1) - result.write(output2) @@ -0,0 +1,140 @@ @@ -0,0 +1,284 @@ |