[Lldb-commits] [lldb] 254e0ab - [lldb] Fix the last remaining tests not inheriting TCC permissions

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 11 12:50:43 PDT 2020


Author: Jonas Devlieghere
Date: 2020-08-11T12:50:36-07:00
New Revision: 254e0abf5be2e98cb7f1fa52617b71f4b94b11a4

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

LOG: [lldb] Fix the last remaining tests not inheriting TCC permissions

After this patch all test should have the inferior inheriting the TCC
permissions from its parent.

Added: 
    

Modified: 
    lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py
    lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
    lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
    lldb/test/API/types/AbstractBase.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py b/lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py
index 2b63fba00e65..127461d7f746 100644
--- a/lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py
+++ b/lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py
@@ -34,20 +34,21 @@ def run_weak_var_check (self, weak_varname, present):
             correct_value = 10
         else:
             correct_value = 20
-            
+
         # Note, I'm adding the "; 10" at the end of the expression to work around
         # the bug that expressions with no result currently return False for Success()...
         expr = "if (&" + weak_varname + " != NULL) { present_weak_int = 10; } else { present_weak_int = 20;}; 10"
         result = self.frame.EvaluateExpression(expr)
         self.assertSuccess(result.GetError(), "absent_weak_int expr failed")
         self.assertEqual(value.GetValueAsSigned(), correct_value, "Didn't change present_weak_int correctly.")
-        
+
     def do_test(self):
         hidden_dir = os.path.join(self.getBuildDir(), "hidden")
         hidden_dylib = os.path.join(hidden_dir, "libdylib.dylib")
 
         launch_info = lldb.SBLaunchInfo(None)
         launch_info.SetWorkingDirectory(self.getBuildDir())
+        launch_info.SetLaunchFlags(lldb.eLaunchFlagInheritTCCFromParent)
 
         (self.target, _, thread, _) = lldbutil.run_to_source_breakpoint(
                                               self, "Set a breakpoint here",
@@ -59,7 +60,7 @@ def do_test(self):
         # search paths, and then run @import to introduce it into the expression
         # context:
         self.dbg.HandleCommand("settings set target.clang-module-search-paths " + self.getSourceDir())
-        
+
         self.frame = thread.frames[0]
         self.assertTrue(self.frame.IsValid(), "Got a good frame")
         options = lldb.SBExpressionOptions()
@@ -69,7 +70,7 @@ def do_test(self):
         # Now run an expression that references an absent weak symbol:
         self.run_weak_var_check("absent_weak_int", False)
         self.run_weak_var_check("absent_weak_function", False)
-        
+
         # Make sure we can do the same thing with present weak symbols
         self.run_weak_var_check("present_weak_int", True)
         self.run_weak_var_check("present_weak_function", True)

diff  --git a/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py b/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
index aaaf4599ef2a..8c5ebd889759 100644
--- a/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
+++ b/lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py
@@ -52,6 +52,7 @@ def test_launch_notifications(self):
             True
 
         error = lldb.SBError()
+        flags = lldb.eLaunchFlagInheritTCCFromParent
         process = target.Launch(listener,
                                 None,      # argv
                                 None,      # envp
@@ -59,7 +60,7 @@ def test_launch_notifications(self):
                                 None,      # stdout_path
                                 None,      # stderr_path
                                 None,      # working directory
-                                0,         # launch flags
+                                flags,     # launch flags
                                 False,     # Stop at entry
                                 error)     # error
 

diff  --git a/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py b/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
index 19eea0ff79a5..9110bea02e98 100644
--- a/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
+++ b/lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py
@@ -23,6 +23,7 @@ def test_objc_exceptions_at_throw(self):
         self.assertTrue(target, VALID_TARGET)
 
         launch_info = lldb.SBLaunchInfo(["a.out", "0"])
+        launch_info.SetLaunchFlags(lldb.eLaunchFlagInheritTCCFromParent)
         lldbutil.run_to_name_breakpoint(self, "objc_exception_throw", launch_info=launch_info)
 
         self.expect("thread list",

diff  --git a/lldb/test/API/types/AbstractBase.py b/lldb/test/API/types/AbstractBase.py
index df8416b9c41f..45f469db9908 100644
--- a/lldb/test/API/types/AbstractBase.py
+++ b/lldb/test/API/types/AbstractBase.py
@@ -151,6 +151,10 @@ def generic_type_tester(
         # This test uses a #include of "basic_type.cpp" so we need to enable
         # always setting inlined breakpoints.
         self.runCmd('settings set target.inline-breakpoint-strategy always')
+
+        # Inherit TCC permissions. We can leave this set.
+        self.runCmd('settings set target.inherit-tcc true')
+
         # And add hooks to restore the settings during tearDown().
         self.addTearDownHook(lambda: self.runCmd(
             "settings set target.inline-breakpoint-strategy headers"))


        


More information about the lldb-commits mailing list