[Lldb-commits] [PATCH] D70127: [lldb-vscode] Fix a race in test_extra_launch_commands

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 12 08:46:10 PST 2019


labath created this revision.
labath added reviewers: clayborg, kusmour, jankratochvil.
Herald added a project: LLDB.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70127

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


Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
@@ -352,7 +352,7 @@
             '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']


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70127.228899.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191112/fe178e76/attachment.bin>


More information about the lldb-commits mailing list