Skip to content

Commit 254e0ab

Browse files
committed
[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.
1 parent e74e8b2 commit 254e0ab

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

lldb/test/API/commands/expression/weak_symbols/TestWeakSymbols.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,21 @@ def run_weak_var_check (self, weak_varname, present):
3434
correct_value = 10
3535
else:
3636
correct_value = 20
37-
37+
3838
# Note, I'm adding the "; 10" at the end of the expression to work around
3939
# the bug that expressions with no result currently return False for Success()...
4040
expr = "if (&" + weak_varname + " != NULL) { present_weak_int = 10; } else { present_weak_int = 20;}; 10"
4141
result = self.frame.EvaluateExpression(expr)
4242
self.assertSuccess(result.GetError(), "absent_weak_int expr failed")
4343
self.assertEqual(value.GetValueAsSigned(), correct_value, "Didn't change present_weak_int correctly.")
44-
44+
4545
def do_test(self):
4646
hidden_dir = os.path.join(self.getBuildDir(), "hidden")
4747
hidden_dylib = os.path.join(hidden_dir, "libdylib.dylib")
4848

4949
launch_info = lldb.SBLaunchInfo(None)
5050
launch_info.SetWorkingDirectory(self.getBuildDir())
51+
launch_info.SetLaunchFlags(lldb.eLaunchFlagInheritTCCFromParent)
5152

5253
(self.target, _, thread, _) = lldbutil.run_to_source_breakpoint(
5354
self, "Set a breakpoint here",
@@ -59,7 +60,7 @@ def do_test(self):
5960
# search paths, and then run @import to introduce it into the expression
6061
# context:
6162
self.dbg.HandleCommand("settings set target.clang-module-search-paths " + self.getSourceDir())
62-
63+
6364
self.frame = thread.frames[0]
6465
self.assertTrue(self.frame.IsValid(), "Got a good frame")
6566
options = lldb.SBExpressionOptions()
@@ -69,7 +70,7 @@ def do_test(self):
6970
# Now run an expression that references an absent weak symbol:
7071
self.run_weak_var_check("absent_weak_int", False)
7172
self.run_weak_var_check("absent_weak_function", False)
72-
73+
7374
# Make sure we can do the same thing with present weak symbols
7475
self.run_weak_var_check("present_weak_int", True)
7576
self.run_weak_var_check("present_weak_function", True)

lldb/test/API/functionalities/target-new-solib-notifications/TestModuleLoadedNotifys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ def test_launch_notifications(self):
5252
True
5353

5454
error = lldb.SBError()
55+
flags = lldb.eLaunchFlagInheritTCCFromParent
5556
process = target.Launch(listener,
5657
None, # argv
5758
None, # envp
5859
None, # stdin_path
5960
None, # stdout_path
6061
None, # stderr_path
6162
None, # working directory
62-
0, # launch flags
63+
flags, # launch flags
6364
False, # Stop at entry
6465
error) # error
6566

lldb/test/API/lang/objc/exceptions/TestObjCExceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test_objc_exceptions_at_throw(self):
2323
self.assertTrue(target, VALID_TARGET)
2424

2525
launch_info = lldb.SBLaunchInfo(["a.out", "0"])
26+
launch_info.SetLaunchFlags(lldb.eLaunchFlagInheritTCCFromParent)
2627
lldbutil.run_to_name_breakpoint(self, "objc_exception_throw", launch_info=launch_info)
2728

2829
self.expect("thread list",

lldb/test/API/types/AbstractBase.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ def generic_type_tester(
151151
# This test uses a #include of "basic_type.cpp" so we need to enable
152152
# always setting inlined breakpoints.
153153
self.runCmd('settings set target.inline-breakpoint-strategy always')
154+
155+
# Inherit TCC permissions. We can leave this set.
156+
self.runCmd('settings set target.inherit-tcc true')
157+
154158
# And add hooks to restore the settings during tearDown().
155159
self.addTearDownHook(lambda: self.runCmd(
156160
"settings set target.inline-breakpoint-strategy headers"))

0 commit comments

Comments
 (0)