mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
[lldb] Add ScriptedPlatform python implementation
This patch introduces both the Scripted Platform python base implementation and an example for it. The base implementation is embedded in lldb python module under `lldb.plugins.scripted_platform`. This patch also refactor the various SWIG methods to create scripted objects into a single method, that is now shared between the Scripted Platform, Process and Thread. It also replaces the target argument by a execution context object. Differential Revision: https://reviews.llvm.org/D139250 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
@@ -20,17 +20,20 @@ class ScriptedProcess(metaclass=ABCMeta):
|
||||
metadata = None
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, target, args):
|
||||
def __init__(self, exe_ctx, args):
|
||||
""" Construct a scripted process.
|
||||
|
||||
Args:
|
||||
target (lldb.SBTarget): The target launching the scripted process.
|
||||
exe_ctx (lldb.SBExecutionContext): The execution context for the scripted process.
|
||||
args (lldb.SBStructuredData): A Dictionary holding arbitrary
|
||||
key/value pairs used by the scripted process.
|
||||
"""
|
||||
target = None
|
||||
self.target = None
|
||||
self.args = None
|
||||
self.arch = None
|
||||
if isinstance(exe_ctx, lldb.SBExecutionContext):
|
||||
target = exe_ctx.target
|
||||
if isinstance(target, lldb.SBTarget) and target.IsValid():
|
||||
self.target = target
|
||||
triple = self.target.triple
|
||||
|
||||
Reference in New Issue
Block a user