summaryrefslogtreecommitdiff
path: root/misc/lldb_rb/commands/rp_command.py
diff options
context:
space:
mode:
authorMatt Valentine-House <[email protected]>2023-03-16 09:54:36 +0000
committerMatt Valentine-House <[email protected]>2023-03-17 20:04:43 +0000
commitc7862c68ebc44e6146f9b10f329eccdb9e5ef5fc (patch)
tree008680d617ceb61b3f200614cedcad7cb664c485 /misc/lldb_rb/commands/rp_command.py
parentcc68d692f80bde4336bbefa2c0872f2a63064edb (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
Notes: Merged: https://github.com/ruby/ruby/pull/7531
Diffstat (limited to 'misc/lldb_rb/commands/rp_command.py')
-rw-r--r--misc/lldb_rb/commands/rp_command.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/misc/lldb_rb/commands/rp_command.py b/misc/lldb_rb/commands/rp_command.py
new file mode 100644
index 0000000000..9da9688b96
--- /dev/null
+++ b/misc/lldb_rb/commands/rp_command.py
@@ -0,0 +1,16 @@
+import lldb
+
+from lldb_rb.constants import *
+from lldb_rb.utils import *
+from lldb_rb.rb_base_command import RbBaseCommand
+
+class RbID2StrCommand(RbBaseCommand):
+ program = "rp"
+
+ help_string = "convert and print a Ruby ID to a C string and print it to the LLDB console"
+
+ def call(self, debugger, command, exe_ctx, result):
+ val = self.frame.EvaluateExpression(command)
+ inspector = RbInspector(debugger, result, self.ruby_globals)
+ inspector.inspect(val)
+