mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 23:45:25 +08:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user