diff options
| author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-02-03 12:28:47 -0800 |
|---|---|---|
| committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-02-03 12:29:01 -0800 |
| commit | c1928033047409f977b26ffc938d59188f1ced97 (patch) | |
| tree | ca2d6248fb629ec8eff457ba992ad4e2447ed864 /lldb/test/API/python_api | |
| parent | a48c4a45e0c517bf1508b3c55cf1d4d875a92353 (diff) | |
| download | llvm-c1928033047409f977b26ffc938d59188f1ced97.zip llvm-c1928033047409f977b26ffc938d59188f1ced97.tar.gz llvm-c1928033047409f977b26ffc938d59188f1ced97.tar.bz2 | |
[lldb] Add a way to get a scripted process implementation from the SBAPI
This patch introduces a new `GetScriptedImplementation` method to the
SBProcess class in the SBAPI. It will allow users of Scripted Processes to
fetch the scripted implementation object from to script interpreter to be
able to interact with it directly (without having to go through lldb).
This allows to user to perform action that are not specified in the
scripted process interface, like calling un-specified methods, but also
to enrich the implementation, by passing it complex objects.
Differential Revision: https://reviews.llvm.org/D143236
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/test/API/python_api')
| -rw-r--r-- | lldb/test/API/python_api/process/TestProcessAPI.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/process/TestProcessAPI.py b/lldb/test/API/python_api/process/TestProcessAPI.py index 3fad30a..cf05335 100644 --- a/lldb/test/API/python_api/process/TestProcessAPI.py +++ b/lldb/test/API/python_api/process/TestProcessAPI.py @@ -18,6 +18,18 @@ class ProcessAPITestCase(TestBase): "main.cpp", "// Set break point at this line and check variable 'my_char'.") + def test_scripted_implementation(self): + self.build() + exe = self.getBuildArtifact("a.out") + + (target, process, _, _) = \ + lldbutil.run_to_source_breakpoint(self, "Set break point", + lldb.SBFileSpec("main.cpp")) + + self.assertTrue(process, PROCESS_IS_VALID) + self.assertEqual(process.GetScriptedImplementation(), None) + + def test_read_memory(self): """Test Python SBProcess.ReadMemory() API.""" self.build() |
