@@ -193,9 +193,11 @@ def print_info(self, terminal):
193193 """
194194 # Print fiber VALUE and address
195195 print (f"Fiber VALUE: " , end = '' )
196- print (terminal .print_type_tag ('T_DATA' , int (self .value ), None ))
196+ terminal .print_type_tag ('T_DATA' , int (self .value ), None )
197+ print ()
197198 print (f" Address: " , end = '' )
198- print (terminal .print_type_tag ('struct rb_fiber_struct' , self .address , None ))
199+ terminal .print_type_tag ('struct rb_fiber_struct' , self .address , None )
200+ print ()
199201
200202 # Print status
201203 print (f" Status: { self .status } " )
@@ -208,16 +210,19 @@ def print_info(self, terminal):
208210 # Print Stack with formatted pointer
209211 stack_type = str (self .stack_base .type )
210212 print (f" Stack: " , end = '' )
211- print (terminal .print_type_tag (stack_type , int (self .stack_base ), f'size={ self .stack_size } ' ))
213+ terminal .print_type_tag (stack_type , int (self .stack_base ))
214+ print ()
212215
213216 # Print VM Stack with formatted pointer
214217 vm_stack_type = str (self .vm_stack .type )
215218 print (f" VM Stack: " , end = '' )
216- print (terminal .print_type_tag (vm_stack_type , int (self .vm_stack ), f'size={ self .vm_stack_size } ' ))
219+ terminal .print_type_tag (vm_stack_type , int (self .vm_stack ))
220+ print ()
217221
218222 # Print CFP
219223 print (f" CFP: " , end = '' )
220- print (terminal .print_type_tag ('rb_control_frame_t' , int (self .cfp ), None ))
224+ terminal .print_type_tag ('rb_control_frame_t' , int (self .cfp ), None )
225+ print ()
221226
222227
223228class RubyFiberScanHeapHandler :
@@ -308,14 +313,8 @@ def load_cache(self, filename):
308313 print (f"Warning: Failed to load cache: { e } " )
309314 return None
310315
311- def invoke (self , arg , from_tty ):
316+ def invoke (self , arguments , terminal ):
312317 global _fiber_cache
313-
314- # Create terminal for formatting
315- terminal = format .create_terminal (from_tty )
316-
317- # Parse arguments using the robust parser
318- arguments = command .parse_arguments (arg if arg else "" )
319318
320319 # Get limit from --limit option
321320 limit = None
@@ -448,9 +447,10 @@ def _print_fiber_info(self, terminal, index, fiber_obj):
448447 """
449448 # Print fiber index with VALUE and pointer
450449 print (f"Fiber #{ index } : " , end = '' )
451- print ( terminal .print_type_tag ('T_DATA' , int (fiber_obj .value )), end = '' )
450+ terminal .print_type_tag ('T_DATA' , int (fiber_obj .value ))
452451 print (' → ' , end = '' )
453- print (terminal .print_type_tag ('struct rb_fiber_struct' , fiber_obj .address ))
452+ terminal .print_type_tag ('struct rb_fiber_struct' , fiber_obj .address )
453+ print ()
454454
455455 # Print status
456456 print (f" Status: { fiber_obj .status } " )
@@ -467,17 +467,20 @@ def _print_fiber_info(self, terminal, index, fiber_obj):
467467 # Print Stack with formatted pointer
468468 stack_type = str (fiber_obj .stack_base .type )
469469 print (f" Stack: " , end = '' )
470- print (terminal .print_type_tag (stack_type , int (fiber_obj .stack_base ), f'size={ fiber_obj .stack_size } ' ))
470+ terminal .print_type_tag (stack_type , int (fiber_obj .stack_base ))
471+ print ()
471472
472473 # Print VM Stack with formatted pointer
473474 vm_stack_type = str (fiber_obj .vm_stack .type )
474475 print (f" VM Stack: " , end = '' )
475- print (terminal .print_type_tag (vm_stack_type , int (fiber_obj .vm_stack ), f'size={ fiber_obj .vm_stack_size } ' ))
476+ terminal .print_type_tag (vm_stack_type , int (fiber_obj .vm_stack ))
477+ print ()
476478
477479 # Print CFP
478480 cfp_type = str (fiber_obj .cfp .type ).replace (' *' , '' ) # Remove pointer marker for display
479481 print (f" CFP: " , end = '' )
480- print (terminal .print_type_tag (cfp_type , int (fiber_obj .cfp )))
482+ terminal .print_type_tag (cfp_type , int (fiber_obj .cfp ))
483+ print ()
481484 print ()
482485
483486
@@ -675,15 +678,16 @@ def _ensure_unwinder(self):
675678 _fiber_unwinder = RubyFiberUnwinder ()
676679 gdb .unwinder .register_unwinder (None , _fiber_unwinder , replace = True )
677680
678- def invoke (self , arg , from_tty ):
681+ def invoke (self , arguments , terminal ):
679682 global _fiber_unwinder
680683
684+ # Check for deactivate
685+ arg = arguments .expressions [0 ] if arguments .expressions else None
681686 if not arg :
682- self . usage ( )
687+ print ( "Error: fiber parameter required" )
683688 return
684689
685- # Check for deactivate
686- if arg and arg .lower () in ('off' , 'none' , 'deactivate' ):
690+ if arg .lower () in ('off' , 'none' , 'deactivate' ):
687691 if debugger .DEBUGGER_NAME == 'gdb' and _fiber_unwinder :
688692 _fiber_unwinder .deactivate ()
689693 set_current_fiber (None )
@@ -759,9 +763,10 @@ def invoke(self, arg, from_tty):
759763
760764 # Print switch confirmation
761765 print (f"Switched to Fiber: " , end = '' )
762- print ( terminal .print_type_tag ('T_DATA' , int (fiber_value ), None ), end = '' )
766+ terminal .print_type_tag ('T_DATA' , int (fiber_value ), None )
763767 print (' → ' , end = '' )
764- print (terminal .print_type_tag ('struct rb_fiber_struct' , fiber_obj .address , None ))
768+ terminal .print_type_tag ('struct rb_fiber_struct' , fiber_obj .address , None )
769+ print ()
765770 print (f" Status: { fiber_obj .status } " )
766771
767772 # Print exception if present (catch errors for terminated fibers)
0 commit comments