[lldb] Use target.GetLaunchInfo() instead of creating an empty one.

Update tests that were creating an empty LaunchInfo instead of using the
one coming from the target. This ensures target properties are honored.
This commit is contained in:
Jonas Devlieghere 2020-08-06 11:45:12 -07:00
parent 9f24148b21
commit 86aa8e6363
12 changed files with 13 additions and 12 deletions

View File

@ -41,7 +41,7 @@ class FrameDisassembleTestCase(TestBase):
# environment variables, add them using SetArguments or
# SetEnvironmentEntries
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
process = target.Launch(launch_info, error)
self.assertTrue(process, PROCESS_IS_VALID)

View File

@ -53,7 +53,7 @@ class TestFrameGuessLanguage(TestBase):
# environment variables, add them using SetArguments or
# SetEnvironmentEntries
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
process = target.Launch(launch_info, error)
self.assertTrue(process, PROCESS_IS_VALID)

View File

@ -42,7 +42,7 @@ class TestFrameVar(TestBase):
# environment variables, add them using SetArguments or
# SetEnvironmentEntries
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
process = target.Launch(launch_info, error)
self.assertTrue(process, PROCESS_IS_VALID)

View File

@ -66,7 +66,7 @@ class TestAutoInstallMainExecutable(gdbremote_testcase.GdbRemoteTestCaseBase):
# Disable the auto install.
self.runCmd("settings set target.auto-install-main-executable false")
self.expect("settings show target.auto-install-main-executable",
self.expect("settings show target.auto-install-main-executable",
substrs=["target.auto-install-main-executable (boolean) = false"])
self.runCmd("platform select %s"%configuration.lldb_platform_name)
@ -80,7 +80,7 @@ class TestAutoInstallMainExecutable(gdbremote_testcase.GdbRemoteTestCaseBase):
target = new_debugger.GetSelectedTarget()
breakpoint = target.BreakpointCreateByName("main")
launch_info = lldb.SBLaunchInfo(None)
launch_info = taget.GetLaunchInfo()
error = lldb.SBError()
process = target.Launch(launch_info, error)
self.assertTrue(process, PROCESS_IS_VALID)

View File

@ -56,6 +56,7 @@ class AddressBreakpointTestCase(TestBase):
launch_info = lldb.SBLaunchInfo(None)
flags = launch_info.GetLaunchFlags()
flags &= ~lldb.eLaunchFlagDisableASLR
flags &= lldb.eLaunchFlagInheritTCCFromParent
launch_info.SetLaunchFlags(flags)
error = lldb.SBError()

View File

@ -46,7 +46,7 @@ class BreakpointAutoContinue(TestBase):
def launch_it (self, expected_state):
error = lldb.SBError()
launch_info = lldb.SBLaunchInfo(None)
launch_info = self.target.GetLaunchInfo()
launch_info.SetWorkingDirectory(self.get_process_working_directory())
process = self.target.Launch(launch_info, error)

View File

@ -47,7 +47,7 @@ class SendSignalTestCase(TestBase):
VALID_BREAKPOINT_LOCATION)
# Now launch the process, no arguments & do not stop at entry point.
launch_info = lldb.SBLaunchInfo([exe])
launch_info = target.GetLaunchInfo()
launch_info.SetWorkingDirectory(self.get_process_working_directory())
process_listener = lldb.SBListener("signal_test_listener")

View File

@ -31,7 +31,7 @@ class TestTailCallFrameSBAPI(TestBase):
VALID_BREAKPOINT)
error = lldb.SBError()
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
process = target.Launch(launch_info, error)
self.assertTrue(process, PROCESS_IS_VALID)

View File

@ -29,7 +29,7 @@ class TestArtificialFrameThreadStepOut1(TestBase):
VALID_BREAKPOINT)
error = lldb.SBError()
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
process = target.Launch(launch_info, error)
self.assertTrue(process, PROCESS_IS_VALID)

View File

@ -23,7 +23,7 @@ class TestInterruptThreadNames(TestBase):
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
error = lldb.SBError()
self.dbg.SetAsync(True)
process = target.Launch(launch_info, error)

View File

@ -339,7 +339,7 @@ class ProcessAPITestCase(TestBase):
self.assertTrue(target, VALID_TARGET)
# Launch the process and stop at the entry point.
launch_info = lldb.SBLaunchInfo(None)
launch_info = target.GetLaunchInfo()
launch_info.SetWorkingDirectory(self.get_process_working_directory())
launch_flags = launch_info.GetLaunchFlags()
launch_flags |= lldb.eLaunchFlagStopAtEntry

View File

@ -135,7 +135,7 @@ class ProcessIOTestCase(TestBase):
def create_target(self):
'''Create the target and launch info that will be used by all tests'''
self.target = self.dbg.CreateTarget(self.exe)
self.launch_info = lldb.SBLaunchInfo([self.exe])
self.launch_info = self.target.GetLaunchInfo()
self.launch_info.SetWorkingDirectory(
self.get_process_working_directory())