diff options
| author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-01-11 23:04:24 -0800 |
|---|---|---|
| committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-01-12 12:49:05 -0800 |
| commit | bb4ccc6688893d1bf38cfca76620d84f947b9de1 (patch) | |
| tree | e4ab50217235c3e27b5f09f1bbeaaaaacefe85dc /lldb/test/API/functionalities/scripted_process | |
| parent | 2d53527e9c64c70c24e1abba74fa0a8c8b3392b1 (diff) | |
| download | llvm-bb4ccc6688893d1bf38cfca76620d84f947b9de1.tar.gz llvm-bb4ccc6688893d1bf38cfca76620d84f947b9de1.tar.bz2 llvm-bb4ccc6688893d1bf38cfca76620d84f947b9de1.zip | |
[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>
Diffstat (limited to 'lldb/test/API/functionalities/scripted_process')
3 files changed, 7 insertions, 7 deletions
diff --git a/lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py b/lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py index d4f795390734..83df1ad8cbbb 100644 --- a/lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py +++ b/lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py @@ -7,8 +7,8 @@ from lldb.plugins.scripted_process import ScriptedProcess from lldb.plugins.scripted_process import ScriptedThread class DummyScriptedProcess(ScriptedProcess): - def __init__(self, target: lldb.SBTarget, args : lldb.SBStructuredData): - super().__init__(target, args) + def __init__(self, exe_ctx: lldb.SBExecutionContext, args : lldb.SBStructuredData): + super().__init__(exe_ctx, args) self.threads[0] = DummyScriptedThread(self, None) def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo: diff --git a/lldb/test/API/functionalities/scripted_process/invalid_scripted_process.py b/lldb/test/API/functionalities/scripted_process/invalid_scripted_process.py index 62db547a1baf..5852df9625d9 100644 --- a/lldb/test/API/functionalities/scripted_process/invalid_scripted_process.py +++ b/lldb/test/API/functionalities/scripted_process/invalid_scripted_process.py @@ -7,8 +7,8 @@ from lldb.plugins.scripted_process import ScriptedProcess from lldb.plugins.scripted_process import ScriptedThread class InvalidScriptedProcess(ScriptedProcess): - def __init__(self, target: lldb.SBTarget, args : lldb.SBStructuredData): - super().__init__(target, args) + def __init__(self, exe_ctx: lldb.SBExecutionContext, args : lldb.SBStructuredData): + super().__init__(exe_ctx, args) self.threads[0] = InvalidScriptedThread(self, None) def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo: diff --git a/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py b/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py index 67a1256c8eef..44a2a37fcc3f 100644 --- a/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py +++ b/lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py @@ -13,8 +13,8 @@ class StackCoreScriptedProcess(ScriptedProcess): return module return None - def __init__(self, target: lldb.SBTarget, args : lldb.SBStructuredData): - super().__init__(target, args) + def __init__(self, exe_ctx: lldb.SBExecutionContext, args : lldb.SBStructuredData): + super().__init__(exe_ctx, args) self.corefile_target = None self.corefile_process = None @@ -25,7 +25,7 @@ class StackCoreScriptedProcess(ScriptedProcess): idx = self.backing_target_idx.GetIntegerValue(42) if self.backing_target_idx.GetType() == lldb.eStructuredDataTypeString: idx = int(self.backing_target_idx.GetStringValue(100)) - self.corefile_target = target.GetDebugger().GetTargetAtIndex(idx) + self.corefile_target = self.target.GetDebugger().GetTargetAtIndex(idx) self.corefile_process = self.corefile_target.GetProcess() for corefile_thread in self.corefile_process: structured_data = lldb.SBStructuredData() |
