@@ -383,6 +383,142 @@ def get_extended_info(self):
383383 """
384384 return self .extended_info
385385
386+ def get_scripted_frame_plugin (self ):
387+ """Get scripted frame plugin name.
388+
389+ Returns:
390+ str: Name of the scripted frame plugin.
391+ """
392+ return None
393+
394+
395+ class ScriptedFrame (metaclass = ABCMeta ):
396+ """
397+ The base class for a scripted frame.
398+
399+ Most of the base class methods are `@abstractmethod` that need to be
400+ overwritten by the inheriting class.
401+ """
402+
403+ @abstractmethod
404+ def __init__ (self , thread , args ):
405+ """Construct a scripted frame.
406+
407+ Args:
408+ thread (ScriptedThread): The thread owning this frame.
409+ args (lldb.SBStructuredData): A Dictionary holding arbitrary
410+ key/value pairs used by the scripted frame.
411+ """
412+ self .target = None
413+ self .originating_thread = None
414+ self .thread = None
415+ self .args = None
416+ self .id = None
417+ self .name = None
418+ self .register_info = None
419+ self .register_ctx = {}
420+ self .variables = []
421+
422+ if (
423+ isinstance (thread , ScriptedThread )
424+ or isinstance (thread , lldb .SBThread )
425+ and thread .IsValid ()
426+ ):
427+ self .target = thread .target
428+ self .process = thread .process
429+ self .originating_thread = thread
430+ self .thread = self .process .GetThreadByIndexID (thread .tid )
431+ self .get_register_info ()
432+
433+ @abstractmethod
434+ def get_id (self ):
435+ """Get the scripted frame identifier.
436+
437+ Returns:
438+ int: The identifier of the scripted frame in the scripted thread.
439+ """
440+ pass
441+
442+ def get_pc (self ):
443+ """Get the scripted frame address.
444+
445+ Returns:
446+ int: The optional address of the scripted frame in the scripted thread.
447+ """
448+ return None
449+
450+ def get_symbol_context (self ):
451+ """Get the scripted frame symbol context.
452+
453+ Returns:
454+ lldb.SBSymbolContext: The symbol context of the scripted frame in the scripted thread.
455+ """
456+ return None
457+
458+ def is_inlined (self ):
459+ """Check if the scripted frame is inlined.
460+
461+ Returns:
462+ bool: True if scripted frame is inlined. False otherwise.
463+ """
464+ return False
465+
466+ def is_artificial (self ):
467+ """Check if the scripted frame is artificial.
468+
469+ Returns:
470+ bool: True if scripted frame is artificial. False otherwise.
471+ """
472+ return True
473+
474+ def is_hidden (self ):
475+ """Check if the scripted frame is hidden.
476+
477+ Returns:
478+ bool: True if scripted frame is hidden. False otherwise.
479+ """
480+ return False
481+
482+ def get_function_name (self ):
483+ """Get the scripted frame function name.
484+
485+ Returns:
486+ str: The function name of the scripted frame.
487+ """
488+ return self .name
489+
490+ def get_display_function_name (self ):
491+ """Get the scripted frame display function name.
492+
493+ Returns:
494+ str: The display function name of the scripted frame.
495+ """
496+ return self .get_function_name ()
497+
498+ def get_variables (self , filters ):
499+ """Get the scripted thread state type.
500+
501+ Args:
502+ filter (lldb.SBVariablesOptions): The filter used to resolve the variables
503+ Returns:
504+ lldb.SBValueList: The SBValueList containing the SBValue for each resolved variable.
505+ Returns None by default.
506+ """
507+ return None
508+
509+ def get_register_info (self ):
510+ if self .register_info is None :
511+ self .register_info = self .originating_thread .get_register_info ()
512+ return self .register_info
513+
514+ @abstractmethod
515+ def get_register_context (self ):
516+ """Get the scripted thread register context
517+
518+ Returns:
519+ str: A byte representing all register's value.
520+ """
521+ pass
386522
387523class PassthroughScriptedProcess (ScriptedProcess ):
388524 driving_target = None
0 commit comments