[Lldb-commits] [lldb] d6f5e08 - [lldb] Kill the inferior instead of detaching during test suite runs

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 9 18:40:14 PST 2020


Author: Jonas Devlieghere
Date: 2020-12-09T18:40:06-08:00
New Revision: d6f5e08199f6454b488814b618aaf17b4a49c8bf

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

LOG: [lldb] Kill the inferior instead of detaching during test suite runs

Kill (rather than detach) form the inferior if debugserver loses its
connection to lldb to prevent zombie processes.

Differential revision: https://reviews.llvm.org/D92908

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbtest.py
    lldb/test/API/types/AbstractBase.py
    lldb/test/Shell/lit-lldb-init.in
    lldb/tools/lldb-test/lldb-test.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 53d1aa40d1ca..1f3bc7722290 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -784,6 +784,9 @@ def setUpCommands(cls):
             # Inherit the TCC permissions from the inferior's parent.
             "settings set target.inherit-tcc true",
 
+            # Kill rather than detach from the inferior if something goes wrong.
+            "settings set target.detach-on-error false",
+
             # Disable fix-its by default so that incorrect expressions in tests don't
             # pass just because Clang thinks it has a fix-it.
             "settings set target.auto-apply-fixits false",

diff  --git a/lldb/test/API/types/AbstractBase.py b/lldb/test/API/types/AbstractBase.py
index 45f469db9908..537c1826d2a4 100644
--- a/lldb/test/API/types/AbstractBase.py
+++ b/lldb/test/API/types/AbstractBase.py
@@ -155,6 +155,9 @@ def generic_type_tester(
         # Inherit TCC permissions. We can leave this set.
         self.runCmd('settings set target.inherit-tcc true')
 
+        # Kill rather than detach from the inferior if something goes wrong.
+        self.runCmd('settings set target.detach-on-error false')
+
         # And add hooks to restore the settings during tearDown().
         self.addTearDownHook(lambda: self.runCmd(
             "settings set target.inline-breakpoint-strategy headers"))

diff  --git a/lldb/test/Shell/lit-lldb-init.in b/lldb/test/Shell/lit-lldb-init.in
index 0fd7cbf1c818..6d3b5fefb3bd 100644
--- a/lldb/test/Shell/lit-lldb-init.in
+++ b/lldb/test/Shell/lit-lldb-init.in
@@ -5,3 +5,4 @@ settings set interpreter.echo-comment-commands false
 settings set symbols.clang-modules-cache-path "@LLDB_TEST_MODULE_CACHE_LLDB@"
 settings set target.auto-apply-fixits false
 settings set target.inherit-tcc true
+settings set target.detach-on-error false

diff  --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp
index 1035ff530204..842a951f384b 100644
--- a/lldb/tools/lldb-test/lldb-test.cpp
+++ b/lldb/tools/lldb-test/lldb-test.cpp
@@ -1105,6 +1105,9 @@ int main(int argc, const char *argv[]) {
   Dbg->GetCommandInterpreter().HandleCommand(
       "settings set target.inherit-tcc true",
       /*add_to_history*/ eLazyBoolNo, Result);
+  Dbg->GetCommandInterpreter().HandleCommand(
+      "settings set target.detach-on-error false",
+      /*add_to_history*/ eLazyBoolNo, Result);
 
   if (!opts::Log.empty())
     Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs());


        


More information about the lldb-commits mailing list