diff options
| author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2021-03-01 23:23:27 +0000 |
|---|---|---|
| committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2021-03-01 23:23:27 +0000 |
| commit | 36254f1a0f32e8a1db353efbe1f8c3a290e5b084 (patch) | |
| tree | 642cb15cc1fc102063f2bccdcd9f670135ee4500 /lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py | |
| parent | a9e68db9736080373d73606d89a270e38d7f1273 (diff) | |
[lldb] Revert ScriptedProcess patches
This patch reverts the following commits:
- 5a9c34918bb1526b7e8c29aa5e4fb8d8e27e27b4
- 46796762afe76496ec4dd900f64d0cf4cdc30e99
- 2cff3dec1171188ce04ab1a4373cc1885ab97be1
- 182f0d1a34419445bb19d67581d6ac1afc98b7fa
- d62a53aaf1d38a55d1affbd3a30d564a4e9d3171
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py')
| -rw-r--r-- | lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py b/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py deleted file mode 100644 index e73535f003d0..000000000000 --- a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -Test python scripted process in lldb -""" - -import os - -import lldb -from lldbsuite.test.decorators import * -from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil -from lldbsuite.test import lldbtest - - -class ScriptedProcesTestCase(TestBase): - - mydir = TestBase.compute_mydir(__file__) - - def setUp(self): - TestBase.setUp(self) - self.source = "main.c" - - def tearDown(self): - TestBase.tearDown(self) - - def test_python_plugin_package(self): - """Test that the lldb python module has a `plugins.scripted_process` - package.""" - self.expect('script import lldb.plugins', - substrs=["ModuleNotFoundError"], matching=False) - - self.expect('script dir(lldb.plugins)', - substrs=["scripted_process"]) - - self.expect('script import lldb.plugins.scripted_process', - substrs=["ModuleNotFoundError"], matching=False) - - self.expect('script dir(lldb.plugins.scripted_process)', - substrs=["ScriptedProcess"]) - - self.expect('script from lldb.plugins.scripted_process import ScriptedProcess', - substrs=["ImportError"], matching=False) - - self.expect('script dir(ScriptedProcess)', - substrs=["launch"]) - - def test_launch_scripted_process_sbapi(self): - """Test that we can launch an lldb scripted process using the SBAPI, - check its process ID and read string from memory.""" - self.build() - target = self.dbg.CreateTarget(self.getBuildArtifact("a.out")) - self.assertTrue(target, VALID_TARGET) - - scripted_process_example_relpath = ['..','..','..','..','examples','python','scripted_process','my_scripted_process.py'] - os.environ['SKIP_SCRIPTED_PROCESS_LAUNCH'] = '1' - self.runCmd("command script import " + os.path.join(self.getSourceDir(), - *scripted_process_example_relpath)) - - launch_info = lldb.SBLaunchInfo(None) - launch_info.SetProcessPluginName('ScriptedProcess') - launch_info.SetScriptedProcessClassName('my_scripted_process.MyScriptedProcess') - - error = lldb.SBError() - process = target.Launch(launch_info, error) - self.assertTrue(process, PROCESS_IS_VALID) - self.assertEqual(process.GetProcessID(), 42) - - hello_world = 'Hello, world!' - memory_read = process.ReadCStringFromMemory(0x50000000000, - len(hello_world) + 1, # NULL byte - error) - - self.assertTrue(error.Success(), "Failed to read memory from scripted process.") - self.assertEqual(hello_world, memory_read) - - def test_launch_scripted_process_cli(self): - """Test that we can launch an lldb scripted process from the command - line, check its process ID and read string from memory.""" - self.build() - target = self.dbg.CreateTarget(self.getBuildArtifact("a.out")) - self.assertTrue(target, VALID_TARGET) - - scripted_process_example_relpath = ['..','..','..','..','examples','python','scripted_process','my_scripted_process.py'] - self.runCmd("command script import " + os.path.join(self.getSourceDir(), - *scripted_process_example_relpath)) - - process = target.GetProcess() - self.assertTrue(process, PROCESS_IS_VALID) - self.assertEqual(process.GetProcessID(), 42) - - error = lldb.SBError() - hello_world = 'Hello, world!' - memory_read = process.ReadCStringFromMemory(0x50000000000, - len(hello_world) + 1, # NULL byte - error) - - self.assertTrue(error.Success(), "Failed to read memory from scripted process.") - self.assertEqual(hello_world, memory_read) |
