Skip to content

Commit d5a47c2

Browse files
rb-print
1 parent 72ce8e6 commit d5a47c2

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

data/toolbox/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ def invoke(self, arg, from_tty):
377377
# Get debug flag
378378
debug = arguments.has_flag('debug')
379379

380-
# Use inspect module to print the storage
381-
import inspect as inspect_module
382-
printer = inspect_module.RubyObjectPrinter()
380+
# Use print module to print the storage
381+
import print as print_module
382+
printer = print_module.RubyObjectPrinter()
383383

384384
# Build arguments for the printer
385385
flags_set = {'debug'} if debug else set()

data/toolbox/debugger/lldb_backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ def get_command(cls, name):
465465

466466

467467
def register(command_name, command_class, usage=None, category=COMMAND_USER):
468+
print(f"DEBUG: Registering command: {command_name} category: {category}")
468469
"""Register a command with LLDB using declarative interface.
469470
470471
Creates a wrapper that handles argument parsing, validation, and delegation.
@@ -527,6 +528,7 @@ def invoke(self, arg, from_tty):
527528
import traceback
528529
traceback.print_exc()
529530

531+
print(f"DEBUG: Returning RegisteredCommand for: {command_name}")
530532
return RegisteredCommand()
531533

532534

data/toolbox/init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# Try to load each extension individually
2626
extensions_to_load = [
27-
('inspect', 'rb-inspect'),
27+
('print', 'rb-inspect'),
2828
('context', 'rb-context, rb-context-storage'),
2929
('fiber', 'rb-fiber-scan-heap, rb-fiber-switch'),
3030
('stack', 'rb-stack-trace'),
@@ -34,9 +34,9 @@
3434
for module_name, commands in extensions_to_load:
3535
try:
3636
print(f"DEBUG: Loading module {module_name}", file=sys.stderr)
37-
if module_name == 'inspect':
38-
import inspect
39-
print(f"DEBUG: inspect module loaded successfully", file=sys.stderr)
37+
if module_name == 'print':
38+
import print as print_module
39+
print(f"DEBUG: print module loaded successfully", file=sys.stderr)
4040
elif module_name == 'context':
4141
import context
4242
elif module_name == 'fiber':
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import rbasic
2020
import format
2121

22+
print("DEBUG: All imports done in inspect.py", file=sys.stderr)
23+
2224

2325
class RubyObjectPrinter:
2426
"""Print Ruby objects with recursive descent into nested structures."""
@@ -77,7 +79,10 @@ def invoke(self, arguments, terminal, from_tty):
7779
traceback.print_exc(file=sys.stderr)
7880

7981

82+
print("DEBUG: RubyObjectPrinter class defined", file=sys.stderr)
83+
8084
# Register command using new interface
85+
print("DEBUG: About to register rb-inspect", file=sys.stderr)
8186
try:
8287
print(f"DEBUG: Registering rb-inspect, debugger.register = {debugger.register}", file=sys.stderr)
8388
result = debugger.register("rb-inspect", RubyObjectPrinter, usage=RubyObjectPrinter.USAGE)

data/toolbox/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ if toolbox_dir not in sys.path:
192192
This allows:
193193
```python
194194
import debugger # data/toolbox/debugger.py
195-
import inspect # data/toolbox/inspect.py
195+
import print # data/toolbox/print.py
196196
import fiber # data/toolbox/fiber.py
197197
from debugger import gdb # data/toolbox/debugger/gdb.py
198198
```

0 commit comments

Comments
 (0)