[Lldb-commits] [lldb] aa16bf1 - [lldb-vscode] Fix a race in test_extra_launch_commands

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 25 01:07:58 PST 2019


Author: Pavel Labath
Date: 2019-11-25T10:07:38+01:00
New Revision: aa16bf15fe38ae4d12d85e7610891dd48e6c0cda

URL: https://github.com/llvm/llvm-project/commit/aa16bf15fe38ae4d12d85e7610891dd48e6c0cda
DIFF: https://github.com/llvm/llvm-project/commit/aa16bf15fe38ae4d12d85e7610891dd48e6c0cda.diff

LOG: [lldb-vscode] Fix a race in test_extra_launch_commands

Summary:
The test used a non-stopping "run" command to launch the process. This
is different from the regular launch with no extra launch commands,
which uses eLaunchFlagStopAtEntry to ensure that the process stops
straight away.

I'm not really sure what's supposed to happen in non-stop-at-entry mode,
or if that's even supported, but what ended up happening was the launch
packet got a reply while the process was running. Then the test case did
a continue_to_next_stop(), which queued a *second* resume request
(along with the internal "resumes" which were being issued as a part of
normal process startup). These two resumes ended up chasing each other's
tails inside lldb in a way which produced hilarious log traces.
Surprisingly, the test ended up passing most of the time, but it did
cause spurious failures when the test seemed to miss a breakpoint.

This changes the test to use stop-at-entry mode in the manual launch
sequence too, which seems to be enough to make the test pass reliably.

Reviewers: clayborg, kusmour, jankratochvil

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70127

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
index 9c75b7e324af..414417f7d7c1 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
@@ -352,7 +352,7 @@ def test_extra_launch_commands(self):
             'target create "%s"' % (program),
             'br s -f main.c -l %d' % first_line,
             'br s -f main.c -l %d' % second_line,
-            'run'
+            'process launch --stop-at-entry'
         ]
 
         initCommands = ['target list', 'platform list']


        


More information about the lldb-commits mailing list