Author: Jonas Devlieghere
Date: 2020-08-06T11:51:26-07:00
New Revision: 86aa8e6363c7e00f211de62ccb3236556e9841df

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

LOG: [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.

Added: 
    

Modified: 
    lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py
    lldb/test/API/commands/frame/language/TestGuessLanguage.py
    lldb/test/API/commands/frame/var/TestFrameVar.py
    
lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
    
lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
    
lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
    lldb/test/API/functionalities/signal/TestSendSignal.py
    
lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
    
lldb/test/API/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
    lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
    lldb/test/API/python_api/process/TestProcessAPI.py
    lldb/test/API/python_api/process/io/TestProcessIO.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py 
b/lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py
index 47973a0d61ed..156458234a16 100644
--- a/lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py
+++ b/lldb/test/API/commands/disassemble/basic/TestFrameDisassemble.py
@@ -41,7 +41,7 @@ def frame_disassemble_test(self):
         # 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)
 

diff  --git a/lldb/test/API/commands/frame/language/TestGuessLanguage.py 
b/lldb/test/API/commands/frame/language/TestGuessLanguage.py
index 32a8950b9711..046f73f37c2b 100644
--- a/lldb/test/API/commands/frame/language/TestGuessLanguage.py
+++ b/lldb/test/API/commands/frame/language/TestGuessLanguage.py
@@ -53,7 +53,7 @@ def do_test(self):
         # 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)
 

diff  --git a/lldb/test/API/commands/frame/var/TestFrameVar.py 
b/lldb/test/API/commands/frame/var/TestFrameVar.py
index 874faf8c64d1..798815fb58be 100644
--- a/lldb/test/API/commands/frame/var/TestFrameVar.py
+++ b/lldb/test/API/commands/frame/var/TestFrameVar.py
@@ -42,7 +42,7 @@ def do_test(self):
         # 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)
 

diff  --git 
a/lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
 
b/lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
index 8ab84bd3203e..47c016e14c2d 100644
--- 
a/lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
+++ 
b/lldb/test/API/commands/target/auto-install-main-executable/TestAutoInstallMainExecutable.py
@@ -66,7 +66,7 @@ def test_target_auto_install_main_executable(self):
 
         # 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 @@ def test_target_auto_install_main_executable(self):
         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)

diff  --git 
a/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
 
b/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
index 1a380ed2dcf9..156f744b7363 100644
--- 
a/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
+++ 
b/lldb/test/API/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
@@ -56,6 +56,7 @@ def address_breakpoints(self):
         launch_info = lldb.SBLaunchInfo(None)
         flags = launch_info.GetLaunchFlags()
         flags &= ~lldb.eLaunchFlagDisableASLR
+        flags &= lldb.eLaunchFlagInheritTCCFromParent
         launch_info.SetLaunchFlags(flags)
 
         error = lldb.SBError()

diff  --git 
a/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
 
b/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
index e0b727e9734f..956bd03f386c 100644
--- 
a/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
+++ 
b/lldb/test/API/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
@@ -46,7 +46,7 @@ def make_target_and_bkpt(self, additional_options=None, 
num_expected_loc=1,
 
     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)

diff  --git a/lldb/test/API/functionalities/signal/TestSendSignal.py 
b/lldb/test/API/functionalities/signal/TestSendSignal.py
index d06322794a63..663ba615e7ae 100644
--- a/lldb/test/API/functionalities/signal/TestSendSignal.py
+++ b/lldb/test/API/functionalities/signal/TestSendSignal.py
@@ -47,7 +47,7 @@ def test_with_run_command(self):
                         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")

diff  --git 
a/lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
 
b/lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
index e597b8d16962..ebd654892abd 100644
--- 
a/lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
+++ 
b/lldb/test/API/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
@@ -31,7 +31,7 @@ def do_test(self):
                         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)
 

diff  --git 
a/lldb/test/API/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
 
b/lldb/test/API/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
index 24fc2ba6956e..55f0f8641be7 100644
--- 
a/lldb/test/API/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
+++ 
b/lldb/test/API/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
@@ -29,7 +29,7 @@ def prepare_thread(self):
                         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)
 

diff  --git a/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py 
b/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
index 887988b52d08..e45ede5156a9 100644
--- a/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
+++ b/lldb/test/API/macosx/thread-names/TestInterruptThreadNames.py
@@ -23,7 +23,7 @@ def test_with_python_api(self):
         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)

diff  --git a/lldb/test/API/python_api/process/TestProcessAPI.py 
b/lldb/test/API/python_api/process/TestProcessAPI.py
index 4442284bf46e..7174ba1c64c4 100644
--- a/lldb/test/API/python_api/process/TestProcessAPI.py
+++ b/lldb/test/API/python_api/process/TestProcessAPI.py
@@ -339,7 +339,7 @@ def test_get_process_info(self):
         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

diff  --git a/lldb/test/API/python_api/process/io/TestProcessIO.py 
b/lldb/test/API/python_api/process/io/TestProcessIO.py
index 3c1c62d2d001..4646c9da58ac 100644
--- a/lldb/test/API/python_api/process/io/TestProcessIO.py
+++ b/lldb/test/API/python_api/process/io/TestProcessIO.py
@@ -135,7 +135,7 @@ def read_error_file_and_delete(self):
     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())
 


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to