1 from abc
import ABCMeta
, abstractmethod
6 class ScriptedPlatform(metaclass
=ABCMeta
):
9 The base class for a scripted platform.
11 Most of the base class methods are `@abstractmethod` that need to be
12 overwritten by the inheriting class.
14 DISCLAIMER: THIS INTERFACE IS STILL UNDER DEVELOPMENT AND NOT STABLE.
15 THE METHODS EXPOSED MIGHT CHANGE IN THE FUTURE.
21 def __init__(self
, exe_ctx
, args
):
22 """Construct a scripted platform.
25 exe_ctx (lldb.SBExecutionContext): The execution context for the scripted platform
26 args (lldb.SBStructuredData): A Dictionary holding arbitrary
27 key/value pairs used by the scripted platform.
32 def list_processes(self
):
33 """Get a list of processes that are running or that can be attached to on the platform.
40 parent_pid: 42 (optional),
47 Dict: The processes represented as a dictionary, with at least the
48 process ID, name, architecture. Optionally, the user can also
49 provide the parent process ID and the user and group IDs.
50 The dictionary can be empty.
54 def get_process_info(self
, pid
):
55 """Get the dictionary describing the process.
58 Dict: The dictionary of process info that matched process ID.
59 None if the process doesn't exists
64 def attach_to_process(self
, attach_info
):
65 """Attach to a process.
68 attach_info (lldb.SBAttachInfo): The information related to attach to a process.
71 lldb.SBError: A status object notifying if the attach succeeded.
76 def launch_process(self
, launch_info
):
80 launch_info (lldb.SBLaunchInfo): The information related to the process launch.
83 lldb.SBError: A status object notifying if the launch succeeded.
88 def kill_process(self
, pid
):
92 pid (int): Process ID for the process to be killed.
95 lldb.SBError: A status object notifying if the shutdown succeeded.