diff options
| author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2022-02-08 14:43:36 -0800 |
|---|---|---|
| committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2022-02-09 13:28:20 -0800 |
| commit | f5e5074c40be29d3a0c5d4ac616df8e61e4ddc63 (patch) | |
| tree | 29030d4999d828921883e8f8a8e28acafef84028 /lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py | |
| parent | 48d889079a8a050bb41defd5688e0b213c1c5655 (diff) | |
[lldb/test] Fix TestScriptedProcess.py timeout on x86_64
This patch fixes a timeout issue on the ScriptedProcess test that was
happening on intel platforms. The timeout was due to a misreporting of
the StopInfo in the ScriptedThread that caused the ScriptedProcess to
never stop.
To solve this, this patch changes the way a ScriptedThread reports its
stop reason by making it more architecture specific. In order to do so,
this patch also refactors the ScriptedProcess & ScriptedThread
initializer methods to provide an easy access to the target architecture.
Differential Revision: https://reviews.llvm.org/D118484
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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py b/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py index 2e80f74622fb..c8ce37c24d49 100644 --- a/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py +++ b/lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py @@ -196,6 +196,22 @@ class ScriptedProcesTestCase(TestBase): self.assertTrue(thread, "Invalid thread.") self.assertEqual(thread.GetName(), "StackCoreScriptedThread.thread-2") + self.assertTrue(target.triple, "Invalid target triple") + arch = target.triple.split('-')[0] + supported_arch = ['x86_64', 'arm64', 'arm64e'] + self.assertIn(arch, supported_arch) + # When creating a corefile of a arm process, lldb saves the exception + # that triggers the breakpoint in the LC_NOTES of the corefile, so they + # can be reloaded with the corefile on the next debug session. + if arch in 'arm64e': + self.assertTrue(thread.GetStopReason(), lldb.eStopReasonException) + # However, it's architecture specific, and corefiles made from intel + # process don't save any metadata to retrieve to stop reason. + # To mitigate this, the StackCoreScriptedProcess will report a + # eStopReasonSignal with a SIGTRAP, mimicking what debugserver does. + else: + self.assertTrue(thread.GetStopReason(), lldb.eStopReasonSignal) + self.assertEqual(thread.GetNumFrames(), 6) frame = thread.GetSelectedFrame() self.assertTrue(frame, "Invalid frame.") |
