[lldb/bindings] Change ScriptedThread initializer parameters

This patch changes the `ScriptedThread` initializer in couple of ways:
- It replaces the `SBTarget` parameter by a `SBProcess` (pointing to the
  `ScriptedProcess` that "owns" the `ScriptedThread`).
- It adds a reference to the `ScriptedProcessInfo` Dictionary, to pass
  arbitrary user-input to the `ScriptedThread`.

This patch also fixes the SWIG bindings methods that call the
`ScriptedProcess` and `ScriptedThread` initializers by passing all the
arguments to the appropriate `PythonCallable` object.

Differential Revision: https://reviews.llvm.org/D112046

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
Med Ismail Bennani
2021-10-19 23:30:22 +00:00
parent ad0f7d3d4a
commit 738621d047
7 changed files with 36 additions and 32 deletions

View File

@@ -190,18 +190,20 @@ class ScriptedThread:
"""
@abstractmethod
def __init__(self, target):
def __init__(self, process, args):
""" Construct a scripted thread.
Args:
target (lldb.SBTarget): The target launching the scripted process.
process (lldb.SBProcess): The scripted process owning this thread.
args (lldb.SBStructuredData): A Dictionary holding arbitrary
key/value pairs used by the scripted process.
key/value pairs used by the scripted thread.
"""
self.target = None
self.process = None
self.args = None
if isinstance(target, lldb.SBTarget) and target.IsValid():
self.target = target
if isinstance(process, lldb.SBProcess) and process.IsValid():
self.process = process
self.target = process.GetTarget()
self.id = None
self.name = None