diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities')
135 files changed, 1414 insertions, 317 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py b/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py index 867b6053a570b..a4e3948e81ca7 100644 --- a/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py +++ b/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py @@ -34,6 +34,7 @@ class AvoidsFdLeakTestCase(TestBase): # here. @skipIfWindows @skipIfTargetAndroid() # Android have some other file descriptors open by the shell + @skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch def test_fd_leak_basic(self): self.do_test([]) @@ -45,6 +46,7 @@ class AvoidsFdLeakTestCase(TestBase): # here. @skipIfWindows @skipIfTargetAndroid() # Android have some other file descriptors open by the shell + @skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch def test_fd_leak_log(self): self.do_test(["log enable -f '/dev/null' lldb commands"]) @@ -76,6 +78,7 @@ class AvoidsFdLeakTestCase(TestBase): # here. @skipIfWindows @skipIfTargetAndroid() # Android have some other file descriptors open by the shell + @skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch def test_fd_leak_multitarget(self): self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/Makefile new file mode 100644 index 0000000000000..6067ee45e9848 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +C_SOURCES := main.c +CFLAGS_EXTRAS += -std=c99 + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py new file mode 100644 index 0000000000000..9630e39e01429 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py @@ -0,0 +1,104 @@ +""" +Test that the breakpoint auto-continue flag works correctly. +""" + +from __future__ import print_function + + +import os +import time +import re +import lldb +import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test.lldbtest import * + + +class BreakpointAutoContinue(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + NO_DEBUG_INFO_TESTCASE = True + + def test_breakpoint_auto_continue(self): + """Make sure the auto continue continues with no other complications""" + self.build() + self.simple_auto_continue() + + def test_auto_continue_with_command(self): + """Add a command, make sure the command gets run""" + self.build() + self.auto_continue_with_command() + + def test_auto_continue_on_location(self): + """Set auto-continue on a location and make sure only that location continues""" + self.build() + self.auto_continue_location() + + def make_target_and_bkpt(self, additional_options=None, num_expected_loc=1, + pattern="Set a breakpoint here"): + exe = os.path.join(os.getcwd(), "a.out") + self.target = self.dbg.CreateTarget(exe) + self.assertTrue(self.target.IsValid(), "Target is not valid") + + extra_options_txt = "--auto-continue 1 " + if additional_options: + extra_options_txt += additional_options + bpno = lldbutil.run_break_set_by_source_regexp(self, pattern, + extra_options = extra_options_txt, + num_expected_locations = num_expected_loc) + return bpno + + def launch_it (self, expected_state): + error = lldb.SBError() + launch_info = lldb.SBLaunchInfo(None) + launch_info.SetWorkingDirectory(self.get_process_working_directory()) + + process = self.target.Launch(launch_info, error) + self.assertTrue(error.Success(), "Launch failed.") + + state = process.GetState() + self.assertEqual(state, expected_state, "Didn't get expected state") + + return process + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + + def simple_auto_continue(self): + bpno = self.make_target_and_bkpt() + process = self.launch_it(lldb.eStateExited) + + bkpt = self.target.FindBreakpointByID(bpno) + self.assertEqual(bkpt.GetHitCount(), 2, "Should have run through the breakpoint twice") + + def auto_continue_with_command(self): + bpno = self.make_target_and_bkpt("-N BKPT -C 'break modify --auto-continue 0 BKPT'") + process = self.launch_it(lldb.eStateStopped) + state = process.GetState() + self.assertEqual(state, lldb.eStateStopped, "Process should be stopped") + bkpt = self.target.FindBreakpointByID(bpno) + threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt) + self.assertEqual(len(threads), 1, "There was a thread stopped at our breakpoint") + self.assertEqual(bkpt.GetHitCount(), 2, "Should have hit the breakpoint twice") + + def auto_continue_location(self): + bpno = self.make_target_and_bkpt(pattern="Set a[^ ]* breakpoint here", num_expected_loc=2) + bkpt = self.target.FindBreakpointByID(bpno) + bkpt.SetAutoContinue(False) + + loc = lldb.SBBreakpointLocation() + for i in range(0,2): + func_name = bkpt.location[i].GetAddress().function.name + if func_name == "main": + loc = bkpt.location[i] + + self.assertTrue(loc.IsValid(), "Didn't find a location in main") + loc.SetAutoContinue(True) + + process = self.launch_it(lldb.eStateStopped) + + threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt) + self.assertEqual(len(threads), 1, "Didn't get one thread stopped at our breakpoint") + func_name = threads[0].frame[0].function.name + self.assertEqual(func_name, "call_me") diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/main.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/main.c new file mode 100644 index 0000000000000..a37f05e0290a9 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/main.c @@ -0,0 +1,19 @@ +#include <stdio.h> + +void +call_me() +{ + printf("Set another breakpoint here.\n"); +} + +int +main() +{ + int change_me = 0; + for (int i = 0; i < 2; i++) + { + printf ("Set a breakpoint here: %d with: %d.\n", i, change_me); + } + call_me(); + return 0; +} diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py index e67a6332d9d20..386eafbb0b60a 100644 --- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py @@ -24,12 +24,21 @@ class BreakpointCommandTestCase(TestBase): cls.RemoveTempFile("output2.txt") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") - def test(self): + def test_breakpoint_command_sequence(self): """Test a sequence of breakpoint command add, list, and delete.""" self.build() self.breakpoint_command_sequence() + + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") + def test_script_parameters(self): + """Test a sequence of breakpoint command add, list, and delete.""" + self.build() self.breakpoint_command_script_parameters() + def test_commands_on_creation(self): + self.build() + self.breakpoint_commands_on_creation() + def setUp(self): # Call super's setUp(). TestBase.setUp(self) @@ -268,3 +277,23 @@ class BreakpointCommandTestCase(TestBase): # Now remove 'output-2.txt' os.remove('output-2.txt') + + def breakpoint_commands_on_creation(self): + """Test that setting breakpoint commands when creating the breakpoint works""" + exe = os.path.join(os.getcwd(), "a.out") + target = self.dbg.CreateTarget(exe) + self.assertTrue(target.IsValid(), "Created an invalid target.") + + # Add a breakpoint. + lldbutil.run_break_set_by_file_and_line( + self, "main.c", self.line, num_expected_locations=1, loc_exact=True, + extra_options='-C bt -C "thread list" -C continue') + + bkpt = target.FindBreakpointByID(1) + self.assertTrue(bkpt.IsValid(), "Couldn't find breakpoint 1") + com_list = lldb.SBStringList() + bkpt.GetCommandLineCommands(com_list) + self.assertEqual(com_list.GetSize(), 3, "Got the wrong number of commands") + self.assertEqual(com_list.GetStringAtIndex(0), "bt", "First bt") + self.assertEqual(com_list.GetStringAtIndex(1), "thread list", "Next thread list") + self.assertEqual(com_list.GetStringAtIndex(2), "continue", "Last continue") diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile new file mode 100644 index 0000000000000..314f1cb2f077b --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/Makefile @@ -0,0 +1,5 @@ +LEVEL = ../../../make + +CXX_SOURCES := main.cpp + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py new file mode 100644 index 0000000000000..5d7b6f9169ad8 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py @@ -0,0 +1,109 @@ +""" +Test breakpoint hit count features. +""" + +from __future__ import print_function + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class BreakpointHitCountTestCase(TestBase): + + NO_DEBUG_INFO_TESTCASE = True + + mydir = TestBase.compute_mydir(__file__) + + @add_test_categories(['pyapi']) + def test_breakpoint_location_hit_count(self): + """Use Python APIs to check breakpoint hit count.""" + self.build() + self.do_test_breakpoint_location_hit_count() + + def setUp(self): + # Call super's setUp(). + TestBase.setUp(self) + self.a_int_body_line_no = line_number( + 'main.cpp', '// Breakpoint Location 1') + self.a_float_body_line_no = line_number( + 'main.cpp', '// Breakpoint Location 2') + + def do_test_breakpoint_location_hit_count(self): + """Use Python APIs to check breakpoint hit count.""" + exe = os.path.join(os.getcwd(), "a.out") + + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) + + # Create a breakpoint in main.cpp by name 'a', + # there should be two locations. + breakpoint = target.BreakpointCreateByName('a', 'a.out') + self.assertTrue(breakpoint and + breakpoint.GetNumLocations() == 2, + VALID_BREAKPOINT) + + # Verify all breakpoint locations are enabled. + location1 = breakpoint.GetLocationAtIndex(0) + self.assertTrue(location1 and + location1.IsEnabled(), + VALID_BREAKPOINT_LOCATION) + + location2 = breakpoint.GetLocationAtIndex(1) + self.assertTrue(location2 and + location2.IsEnabled(), + VALID_BREAKPOINT_LOCATION) + + # Launch the process, and do not stop at entry point. + process = target.LaunchSimple( + None, None, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) + + # Verify 1st breakpoint location is hit. + from lldbsuite.test.lldbutil import get_stopped_thread + thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) + self.assertTrue( + thread.IsValid(), + "There should be a thread stopped due to breakpoint") + + frame0 = thread.GetFrameAtIndex(0) + location1 = breakpoint.FindLocationByAddress(frame0.GetPC()) + self.assertTrue( + frame0.GetLineEntry().GetLine() == self.a_int_body_line_no, + "Stopped in int a(int)") + self.assertTrue(location1) + self.assertEqual(location1.GetHitCount(), 1) + self.assertEqual(breakpoint.GetHitCount(), 1) + + process.Continue() + + # Verify 2nd breakpoint location is hit. + thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) + self.assertTrue( + thread.IsValid(), + "There should be a thread stopped due to breakpoint") + + frame0 = thread.GetFrameAtIndex(0) + location2 = breakpoint.FindLocationByAddress(frame0.GetPC()) + self.assertTrue( + frame0.GetLineEntry().GetLine() == self.a_float_body_line_no, + "Stopped in float a(float)") + self.assertTrue(location2) + self.assertEqual(location2.GetHitCount(), 1) + self.assertEqual(location1.GetHitCount(), 1) + self.assertEqual(breakpoint.GetHitCount(), 2) + + process.Continue() + + # Verify 2nd breakpoint location is hit again. + thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint) + self.assertTrue( + thread.IsValid(), + "There should be a thread stopped due to breakpoint") + + self.assertEqual(location2.GetHitCount(), 2) + self.assertEqual(location1.GetHitCount(), 1) + self.assertEqual(breakpoint.GetHitCount(), 3) + + process.Continue() diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp new file mode 100644 index 0000000000000..333e9b6405a74 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/main.cpp @@ -0,0 +1,27 @@ +//===-- main.cpp ------------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +int a(int val) +{ + return val; // Breakpoint Location 1 +} + +float a(float val) +{ + return val; // Breakpoint Location 2 +} + +int main (int argc, char const *argv[]) +{ + int A1 = a(1); + float A2 = a(2.0f); + float A3 = a(3.0f); + + return 0; +} diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py index fdbd622f767b4..de24d8b002d7c 100644 --- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py @@ -18,27 +18,40 @@ class BreakpointLocationsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") - def test(self): + def test_enable(self): """Test breakpoint enable/disable for a breakpoint ID with multiple locations.""" self.build() self.breakpoint_locations_test() + def test_shadowed_cond_options(self): + """Test that options set on the breakpoint and location behave correctly.""" + self.build() + self.shadowed_bkpt_cond_test() + + + def test_shadowed_command_options(self): + """Test that options set on the breakpoint and location behave correctly.""" + self.build() + self.shadowed_bkpt_command_test() + def setUp(self): # Call super's setUp(). TestBase.setUp(self) # Find the line number to break inside main(). self.line = line_number('main.c', '// Set break point at this line.') - def breakpoint_locations_test(self): - """Test breakpoint enable/disable for a breakpoint ID with multiple locations.""" + def set_breakpoint (self): exe = os.path.join(os.getcwd(), "a.out") - self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, "Target %s is not valid"%(exe)) # This should create a breakpoint with 3 locations. - lldbutil.run_break_set_by_file_and_line( - self, "main.c", self.line, num_expected_locations=3) + + bkpt = target.BreakpointCreateByLocation("main.c", self.line) # The breakpoint list should show 3 locations. + self.assertEqual(bkpt.GetNumLocations(), 3, "Wrong number of locations") + self.expect( "breakpoint list -f", "Breakpoint locations shown correctly", @@ -49,6 +62,87 @@ class BreakpointLocationsTestCase(TestBase): "where = a.out`func_inlined .+unresolved, hit count = 0", "where = a.out`main .+\[inlined\].+unresolved, hit count = 0"]) + return bkpt + + def shadowed_bkpt_cond_test(self): + """Test that options set on the breakpoint and location behave correctly.""" + # Breakpoint option propagation from bkpt to loc used to be done the first time + # a breakpoint location option was specifically set. After that the other options + # on that location would stop tracking the breakpoint. That got fixed, and this test + # makes sure only the option touched is affected. + + bkpt = self.set_breakpoint() + bkpt_cond = "1 == 0" + bkpt.SetCondition(bkpt_cond) + self.assertEqual(bkpt.GetCondition(), bkpt_cond,"Successfully set condition") + self.assertTrue(bkpt.location[0].GetCondition() == bkpt.GetCondition(), "Conditions are the same") + + # Now set a condition on the locations, make sure that this doesn't effect the bkpt: + bkpt_loc_1_cond = "1 == 1" + bkpt.location[0].SetCondition(bkpt_loc_1_cond) + self.assertEqual(bkpt.location[0].GetCondition(), bkpt_loc_1_cond, "Successfully changed location condition") + self.assertNotEqual(bkpt.GetCondition(), bkpt_loc_1_cond, "Changed location changed Breakpoint condition") + self.assertEqual(bkpt.location[1].GetCondition(), bkpt_cond, "Changed another location's condition") + + # Now make sure that setting one options doesn't fix the value of another: + bkpt.SetIgnoreCount(10) + self.assertEqual(bkpt.GetIgnoreCount(), 10, "Set the ignore count successfully") + self.assertEqual(bkpt.location[0].GetIgnoreCount(), 10, "Location doesn't track top-level bkpt.") + + # Now make sure resetting the condition to "" resets the tracking: + bkpt.location[0].SetCondition("") + bkpt_new_cond = "1 == 3" + bkpt.SetCondition(bkpt_new_cond) + self.assertEqual(bkpt.location[0].GetCondition(), bkpt_new_cond, "Didn't go back to tracking condition") + + def shadowed_bkpt_command_test(self): + """Test that options set on the breakpoint and location behave correctly.""" + # Breakpoint option propagation from bkpt to loc used to be done the first time + # a breakpoint location option was specifically set. After that the other options + # on that location would stop tracking the breakpoint. That got fixed, and this test + # makes sure only the option touched is affected. + + bkpt = self.set_breakpoint() + commands = ["AAAAAA", "BBBBBB", "CCCCCC"] + str_list = lldb.SBStringList() + str_list.AppendList(commands, len(commands)) + + bkpt.SetCommandLineCommands(str_list) + cmd_list = lldb.SBStringList() + bkpt.GetCommandLineCommands(cmd_list) + list_size = str_list.GetSize() + self.assertEqual(cmd_list.GetSize() , list_size, "Added the right number of commands") + for i in range(0,list_size): + self.assertEqual(str_list.GetStringAtIndex(i), cmd_list.GetStringAtIndex(i), "Mismatched commands.") + + commands = ["DDDDDD", "EEEEEE", "FFFFFF", "GGGGGG"] + loc_list = lldb.SBStringList() + loc_list.AppendList(commands, len(commands)) + bkpt.location[1].SetCommandLineCommands(loc_list) + loc_cmd_list = lldb.SBStringList() + bkpt.location[1].GetCommandLineCommands(loc_cmd_list) + + loc_list_size = loc_list.GetSize() + + # Check that the location has the right commands: + self.assertEqual(loc_cmd_list.GetSize() , loc_list_size, "Added the right number of commands to location") + for i in range(0,loc_list_size): + self.assertEqual(loc_list.GetStringAtIndex(i), loc_cmd_list.GetStringAtIndex(i), "Mismatched commands.") + + # Check that we didn't mess up the breakpoint level commands: + self.assertEqual(cmd_list.GetSize() , list_size, "Added the right number of commands") + for i in range(0,list_size): + self.assertEqual(str_list.GetStringAtIndex(i), cmd_list.GetStringAtIndex(i), "Mismatched commands.") + + # And check we didn't mess up another location: + untouched_loc_cmds = lldb.SBStringList() + bkpt.location[0].GetCommandLineCommands(untouched_loc_cmds) + self.assertEqual(untouched_loc_cmds.GetSize() , 0, "Changed the wrong location") + + def breakpoint_locations_test(self): + """Test breakpoint enable/disable for a breakpoint ID with multiple locations.""" + self.set_breakpoint() + # The 'breakpoint disable 3.*' command should fail gracefully. self.expect("breakpoint disable 3.*", "Disabling an invalid breakpoint should fail gracefully", @@ -80,7 +174,7 @@ class BreakpointLocationsTestCase(TestBase): "1 breakpoint locatons disabled correctly", startstr="1 breakpoints disabled.") - # Run the program againt. We should stop on the two breakpoint + # Run the program again. We should stop on the two breakpoint # locations. self.runCmd("run", RUN_SUCCEEDED) diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py index cc31ef80e8a32..b95d2cea550ab 100644 --- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py @@ -17,6 +17,7 @@ from lldbsuite.test import lldbutil class BreakpointNames(TestBase): mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True @add_test_categories(['pyapi']) def test_setting_names(self): @@ -37,6 +38,25 @@ class BreakpointNames(TestBase): self.setup_target() self.do_check_using_names() + def test_configuring_names(self): + """Use Python APIs to test that configuring options on breakpoint names works correctly.""" + self.build() + self.make_a_dummy_name() + self.setup_target() + self.do_check_configuring_names() + + def test_configuring_permissions_sb(self): + """Use Python APIs to test that configuring permissions on names works correctly.""" + self.build() + self.setup_target() + self.do_check_configuring_permissions_sb() + + def test_configuring_permissions_cli(self): + """Use Python APIs to test that configuring permissions on names works correctly.""" + self.build() + self.setup_target() + self.do_check_configuring_permissions_cli() + def setup_target(self): exe = os.path.join(os.getcwd(), "a.out") @@ -45,10 +65,36 @@ class BreakpointNames(TestBase): self.assertTrue(self.target, VALID_TARGET) self.main_file_spec = lldb.SBFileSpec(os.path.join(os.getcwd(), "main.c")) + def check_name_in_target(self, bkpt_name): + name_list = lldb.SBStringList() + self.target.GetBreakpointNames(name_list) + found_it = False + for name in name_list: + if name == bkpt_name: + found_it = True + break + self.assertTrue(found_it, "Didn't find the name %s in the target's name list:"%(bkpt_name)) + def setUp(self): # Call super's setUp(). TestBase.setUp(self) + # These are the settings we're going to be putting into names & breakpoints: + self.bp_name_string = "ABreakpoint" + self.is_one_shot = True + self.ignore_count = 1000 + self.condition = "1 == 2" + self.auto_continue = True + self.tid = 0xaaaa + self.tidx = 10 + self.thread_name = "Fooey" + self.queue_name = "Blooey" + self.cmd_list = lldb.SBStringList() + self.cmd_list.AppendString("frame var") + self.cmd_list.AppendString("bt") + self.help_string = "I do something interesting" + + def do_check_names(self): """Use Python APIs to check that we can set & retrieve breakpoint names""" bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) @@ -66,11 +112,15 @@ class BreakpointNames(TestBase): matches = bkpt.MatchesName("NotABreakpoint") self.assertTrue(not matches, "We matched a name we didn't set.") + # Make sure the name is also in the target: + self.check_name_in_target(bkpt_name) + # Add another name, make sure that works too: bkpt.AddName(other_bkpt_name) matches = bkpt.MatchesName(bkpt_name) self.assertTrue(matches, "Adding a name means we didn't match the name we just set") + self.check_name_in_target(other_bkpt_name) # Remove the name and make sure we no longer match it: bkpt.RemoveName(bkpt_name) @@ -89,26 +139,21 @@ class BreakpointNames(TestBase): def do_check_illegal_names(self): """Use Python APIs to check that we reject illegal names.""" bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) - success = bkpt.AddName("-CantStartWithADash") - self.assertTrue(not success,"We allowed a name starting with a dash.") - - success = bkpt.AddName("1CantStartWithANumber") - self.assertTrue(not success, "We allowed a name starting with a number.") - - success = bkpt.AddName("^CantStartWithNonAlpha") - self.assertTrue(not success, "We allowed a name starting with an ^.") + bad_names = ["-CantStartWithADash", + "1CantStartWithANumber", + "^CantStartWithNonAlpha", + "CantHave-ADash", + "Cant Have Spaces"] + for bad_name in bad_names: + success = bkpt.AddName(bad_name) + self.assertTrue(not success,"We allowed an illegal name: %s"%(bad_name)) + bp_name = lldb.SBBreakpointName(self.target, bad_name) + self.assertFalse(bp_name.IsValid(), "We made a breakpoint name with an illegal name: %s"%(bad_name)); - success = bkpt.AddName("CantHave-ADash") - self.assertTrue(not success, "We allowed a name with a dash in it.") + retval =lldb.SBCommandReturnObject() + self.dbg.GetCommandInterpreter().HandleCommand("break set -n whatever -N '%s'"%(bad_name), retval) + self.assertTrue(not retval.Succeeded(), "break set succeeded with: illegal name: %s"%(bad_name)) - success = bkpt.AddName("Cant Have Spaces") - self.assertTrue(not success, "We allowed a name with spaces.") - - # Check from the command line as well: - retval =lldb.SBCommandReturnObject() - self.dbg.GetCommandInterpreter().HandleCommand("break set -n whatever -N has-dashes", retval) - self.assertTrue(not retval.Succeeded(), "break set succeeded with: illegal name") - def do_check_using_names(self): """Use Python APIs to check names work in place of breakpoint ID's.""" @@ -133,9 +178,190 @@ class BreakpointNames(TestBase): self.assertTrue(not bkpt.IsEnabled(), "We didn't disable the breakpoint.") # Also make sure we don't apply commands to non-matching names: - self.dbg.GetCommandInterpreter().HandleCommand("break modify --one-shot 1 %s"%(bkpt_name), retval) + self.dbg.GetCommandInterpreter().HandleCommand("break modify --one-shot 1 %s"%(other_bkpt_name), retval) self.assertTrue(retval.Succeeded(), "break modify failed with: %s."%(retval.GetError())) self.assertTrue(not bkpt.IsOneShot(), "We applied one-shot to the wrong breakpoint.") + def check_option_values(self, bp_object): + self.assertEqual(bp_object.IsOneShot(), self.is_one_shot, "IsOneShot") + self.assertEqual(bp_object.GetIgnoreCount(), self.ignore_count, "IgnoreCount") + self.assertEqual(bp_object.GetCondition(), self.condition, "Condition") + self.assertEqual(bp_object.GetAutoContinue(), self.auto_continue, "AutoContinue") + self.assertEqual(bp_object.GetThreadID(), self.tid, "Thread ID") + self.assertEqual(bp_object.GetThreadIndex(), self.tidx, "Thread Index") + self.assertEqual(bp_object.GetThreadName(), self.thread_name, "Thread Name") + self.assertEqual(bp_object.GetQueueName(), self.queue_name, "Queue Name") + set_cmds = lldb.SBStringList() + bp_object.GetCommandLineCommands(set_cmds) + self.assertEqual(set_cmds.GetSize(), self.cmd_list.GetSize(), "Size of command line commands") + for idx in range(0, set_cmds.GetSize()): + self.assertEqual(self.cmd_list.GetStringAtIndex(idx), set_cmds.GetStringAtIndex(idx), "Command %d"%(idx)) + + def make_a_dummy_name(self): + "This makes a breakpoint name in the dummy target to make sure it gets copied over" + + dummy_target = self.dbg.GetDummyTarget() + self.assertTrue(dummy_target.IsValid(), "Dummy target was not valid.") + + def cleanup (): + self.dbg.GetDummyTarget().DeleteBreakpointName(self.bp_name_string) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + # Now find it in the dummy target, and make sure these settings took: + bp_name = lldb.SBBreakpointName(dummy_target, self.bp_name_string) + # Make sure the name is right: + self.assertTrue (bp_name.GetName() == self.bp_name_string, "Wrong bp_name: %s"%(bp_name.GetName())) + bp_name.SetOneShot(self.is_one_shot) + bp_name.SetIgnoreCount(self.ignore_count) + bp_name.SetCondition(self.condition) + bp_name.SetAutoContinue(self.auto_continue) + bp_name.SetThreadID(self.tid) + bp_name.SetThreadIndex(self.tidx) + bp_name.SetThreadName(self.thread_name) + bp_name.SetQueueName(self.queue_name) + bp_name.SetCommandLineCommands(self.cmd_list) + + # Now look it up again, and make sure it got set correctly. + bp_name = lldb.SBBreakpointName(dummy_target, self.bp_name_string) + self.assertTrue(bp_name.IsValid(), "Failed to make breakpoint name.") + self.check_option_values(bp_name) + + def do_check_configuring_names(self): + """Use Python APIs to check that configuring breakpoint names works correctly.""" + other_bp_name_string = "AnotherBreakpointName" + cl_bp_name_string = "CLBreakpointName" + + # Now find the version copied in from the dummy target, and make sure these settings took: + bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) + self.assertTrue(bp_name.IsValid(), "Failed to make breakpoint name.") + self.check_option_values(bp_name) + + # Now add this name to a breakpoint, and make sure it gets configured properly + bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) + success = bkpt.AddName(self.bp_name_string) + self.assertTrue(success, "Couldn't add this name to the breakpoint") + self.check_option_values(bkpt) + + # Now make a name from this breakpoint, and make sure the new name is properly configured: + new_name = lldb.SBBreakpointName(bkpt, other_bp_name_string) + self.assertTrue(new_name.IsValid(), "Couldn't make a valid bp_name from a breakpoint.") + self.check_option_values(bkpt) + + # Now change the name's option and make sure it gets propagated to + # the breakpoint: + new_auto_continue = not self.auto_continue + bp_name.SetAutoContinue(new_auto_continue) + self.assertEqual(bp_name.GetAutoContinue(), new_auto_continue, "Couldn't change auto-continue on the name") + self.assertEqual(bkpt.GetAutoContinue(), new_auto_continue, "Option didn't propagate to the breakpoint.") + # Now make this same breakpoint name - but from the command line + cmd_str = "breakpoint name configure %s -o %d -i %d -c '%s' -G %d -t %d -x %d -T '%s' -q '%s' -H '%s'"%(cl_bp_name_string, + self.is_one_shot, + self.ignore_count, + self.condition, + self.auto_continue, + self.tid, + self.tidx, + self.thread_name, + self.queue_name, + self.help_string) + for cmd in self.cmd_list: + cmd_str += " -C '%s'"%(cmd) + + self.runCmd(cmd_str, check=True) + # Now look up this name again and check its options: + cl_name = lldb.SBBreakpointName(self.target, cl_bp_name_string) + self.check_option_values(cl_name) + # Also check the help string: + self.assertEqual(self.help_string, cl_name.GetHelpString(), "Help string didn't match") + # Change the name and make sure that works: + new_help = "I do something even more interesting" + cl_name.SetHelpString(new_help) + self.assertEqual(new_help, cl_name.GetHelpString(), "SetHelpString didn't") + + # We should have three names now, make sure the target can list them: + name_list = lldb.SBStringList() + self.target.GetBreakpointNames(name_list) + for name_string in [self.bp_name_string, other_bp_name_string, cl_bp_name_string]: + self.assertTrue(name_string in name_list, "Didn't find %s in names"%(name_string)) + + # Delete the name from the current target. Make sure that works and deletes the + # name from the breakpoint as well: + self.target.DeleteBreakpointName(self.bp_name_string) + name_list.Clear() + self.target.GetBreakpointNames(name_list) + self.assertTrue(self.bp_name_string not in name_list, "Didn't delete %s from a real target"%(self.bp_name_string)) + # Also make sure the name got removed from breakpoints holding it: + self.assertFalse(bkpt.MatchesName(self.bp_name_string), "Didn't remove the name from the breakpoint.") + + # Test that deleting the name we injected into the dummy target works (there's also a + # cleanup that will do this, but that won't test the result... + dummy_target = self.dbg.GetDummyTarget() + dummy_target.DeleteBreakpointName(self.bp_name_string) + name_list.Clear() + dummy_target.GetBreakpointNames(name_list) + self.assertTrue(self.bp_name_string not in name_list, "Didn't delete %s from the dummy target"%(self.bp_name_string)) + # Also make sure the name got removed from breakpoints holding it: + self.assertFalse(bkpt.MatchesName(self.bp_name_string), "Didn't remove the name from the breakpoint.") + def check_permission_results(self, bp_name): + self.assertEqual(bp_name.GetAllowDelete(), False, "Didn't set allow delete.") + protected_bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) + protected_id = protected_bkpt.GetID() + + unprotected_bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) + unprotected_id = unprotected_bkpt.GetID() + + success = protected_bkpt.AddName(self.bp_name_string) + self.assertTrue(success, "Couldn't add this name to the breakpoint") + + self.target.DisableAllBreakpoints() + self.assertEqual(protected_bkpt.IsEnabled(), True, "Didnt' keep breakpoint from being disabled") + self.assertEqual(unprotected_bkpt.IsEnabled(), False, "Protected too many breakpoints from disabling.") + + # Try from the command line too: + unprotected_bkpt.SetEnabled(True) + result = lldb.SBCommandReturnObject() + self.dbg.GetCommandInterpreter().HandleCommand("break disable", result) + self.assertTrue(result.Succeeded()) + self.assertEqual(protected_bkpt.IsEnabled(), True, "Didnt' keep breakpoint from being disabled") + self.assertEqual(unprotected_bkpt.IsEnabled(), False, "Protected too many breakpoints from disabling.") + + self.target.DeleteAllBreakpoints() + bkpt = self.target.FindBreakpointByID(protected_id) + self.assertTrue(bkpt.IsValid(), "Didn't keep the breakpoint from being deleted.") + bkpt = self.target.FindBreakpointByID(unprotected_id) + self.assertFalse(bkpt.IsValid(), "Protected too many breakpoints from deletion.") + + # Remake the unprotected breakpoint and try again from the command line: + unprotected_bkpt = self.target.BreakpointCreateByLocation(self.main_file_spec, 10) + unprotected_id = unprotected_bkpt.GetID() + + self.dbg.GetCommandInterpreter().HandleCommand("break delete -f", result) + self.assertTrue(result.Succeeded()) + bkpt = self.target.FindBreakpointByID(protected_id) + self.assertTrue(bkpt.IsValid(), "Didn't keep the breakpoint from being deleted.") + bkpt = self.target.FindBreakpointByID(unprotected_id) + self.assertFalse(bkpt.IsValid(), "Protected too many breakpoints from deletion.") + + def do_check_configuring_permissions_sb(self): + bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) + + # Make a breakpoint name with delete disallowed: + bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) + self.assertTrue(bp_name.IsValid(), "Failed to make breakpoint name for valid name.") + + bp_name.SetAllowDelete(False) + bp_name.SetAllowDisable(False) + bp_name.SetAllowList(False) + self.check_permission_results(bp_name) + + def do_check_configuring_permissions_cli(self): + # Make the name with the right options using the command line: + self.runCmd("breakpoint name configure -L 0 -D 0 -A 0 %s"%(self.bp_name_string), check=True) + # Now look up the breakpoint we made, and check that it works. + bp_name = lldb.SBBreakpointName(self.target, self.bp_name_string) + self.assertTrue(bp_name.IsValid(), "Didn't make a breakpoint name we could find.") + self.check_permission_results(bp_name) diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile new file mode 100644 index 0000000000000..801c1041bbe16 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile @@ -0,0 +1,8 @@ +LEVEL = ../../../make + +DYLIB_NAME := foo +DYLIB_CXX_SOURCES := foo.cpp +CXX_SOURCES := main.cpp +CFLAGS_EXTRAS := -fPIC + +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py new file mode 100644 index 0000000000000..4dfa03d5fab4e --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py @@ -0,0 +1,46 @@ +""" +Test that we can hit breakpoints in global constructors +""" + +from __future__ import print_function + + +import os +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestBreakpointInGlobalConstructors(TestBase): + + mydir = TestBase.compute_mydir(__file__) + NO_DEBUG_INFO_TESTCASE = True + + def setUp(self): + TestBase.setUp(self) + self.line_foo = line_number('foo.cpp', '// !BR_foo') + self.line_main = line_number('main.cpp', '// !BR_main') + + @expectedFailureAll(bugnumber="llvm.org/pr35480", oslist=["linux"]) + def test(self): + self.build() + exe = os.path.join(os.getcwd(), "a.out") + self.runCmd("file %s" % exe) + + bp_main = lldbutil.run_break_set_by_file_and_line( + self, 'main.cpp', self.line_main) + bp_foo = lldbutil.run_break_set_by_file_and_line( + self, 'foo.cpp', self.line_foo) + + self.runCmd("run") + + self.assertIsNotNone( + lldbutil.get_one_thread_stopped_at_breakpoint_id( + self.process(), bp_foo)) + + self.runCmd("continue") + + self.assertIsNotNone( + lldbutil.get_one_thread_stopped_at_breakpoint_id( + self.process(), bp_main)) diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/foo.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/foo.cpp new file mode 100644 index 0000000000000..f959a295467f7 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/foo.cpp @@ -0,0 +1,7 @@ +#include "foo.h" + +Foo::Foo() : x(42) { + bool some_code = x == 42; // !BR_foo +} + +Foo FooObj; diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/foo.h b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/foo.h new file mode 100644 index 0000000000000..3bc63fed7555b --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/foo.h @@ -0,0 +1,11 @@ +#ifndef FOO_H +#define FOO_H + +struct LLDB_TEST_API Foo { + Foo(); + int x; +}; + +extern LLDB_TEST_API Foo FooObj; + +#endif diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/main.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/main.cpp new file mode 100644 index 0000000000000..d1c8038dfadbd --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/main.cpp @@ -0,0 +1,14 @@ +#include "foo.h" + +struct Main { + Main(); + int x; +}; + +Main::Main() : x(47) { + bool some_code = x == 47; // !BR_main +} + +Main MainObj; + +int main() { return MainObj.x + FooObj.x; } diff --git a/packages/Python/lldbsuite/test/functionalities/command_source/.lldb b/packages/Python/lldbsuite/test/functionalities/command_source/.lldb index c544523832e76..ecbdcff44626d 100644 --- a/packages/Python/lldbsuite/test/functionalities/command_source/.lldb +++ b/packages/Python/lldbsuite/test/functionalities/command_source/.lldb @@ -1 +1,2 @@ -script import my +# one more level of indirection to stress the command interpreter reentrancy +command source commands.txt diff --git a/packages/Python/lldbsuite/test/functionalities/command_source/commands.txt b/packages/Python/lldbsuite/test/functionalities/command_source/commands.txt new file mode 100644 index 0000000000000..8e4de66d46901 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/command_source/commands.txt @@ -0,0 +1,2 @@ +script import my +p 1 + 1 diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py index 0459058f3ae92..410da702b93d8 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py @@ -54,7 +54,7 @@ class DataFormatterBoolRefPtr(TestBase): # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) - isiOS = (lldbplatformutil.getPlatform() == 'ios') + isiOS = (lldbplatformutil.getPlatform() == 'ios' or lldbplatformutil.getPlatform() == 'watchos') # Now check that we use the right summary for BOOL& self.expect('frame variable yes_ref', diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py index 2d66a941ed347..750e294607325 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py @@ -46,6 +46,7 @@ class NSIndexPathDataFormatterTestCase(TestBase): @skipUnlessDarwin @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656605") + @expectedFailureAll(archs=['armv7', 'armv7k'], bugnumber="rdar://problem/34561607") # NSIndexPath formatter isn't working for 32-bit arm def test_nsindexpath_with_run_command(self): """Test formatters for NSIndexPath.""" self.appkit_tester_impl(self.nsindexpath_data_formatter_commands) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile index a92cffcc319b6..637404f1bd0a5 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile @@ -1,14 +1,7 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp -USE_LIBSTDCPP := 1 - -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif +USE_LIBSTDCPP := 0 include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py index 5b52277e8b7a1..b0b45cb831b00 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py @@ -172,23 +172,6 @@ class SkipSummaryDataFormatterTestCase(TestBase): 'm_child2 = {', 'm_some_text = "Just a test"']) - # Expand within a standard string (might depend on the implementation - # of the C++ stdlib you use) - self.expect( - 'frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=2', - substrs=[ - '(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {', - 'm_some_text = {', - '_M_dataplus = (_M_p = "Just a test")']) - - # Repeat the above, but only skip 1 level of summaries - self.expect( - 'frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=1', - substrs=[ - '(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {', - 'm_some_text = "Just a test"', - '}']) - # Change summary and expand, first without --no-summary-depth then with # --no-summary-depth self.runCmd( diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/Makefile new file mode 100644 index 0000000000000..bf75013f531d2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../../../make + +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py new file mode 100644 index 0000000000000..73a1b4e16bf62 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py @@ -0,0 +1,46 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestDataFormatterLibcxxBitset(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + TestBase.setUp(self) + + primes = [1]*300 + primes[0] = primes[1] = 0 + for i in range(2, len(primes)): + for j in range(2*i, len(primes), i): + primes[j] = 0 + self.primes = primes + + def check(self, name, size): + var = self.frame().FindVariable(name) + self.assertTrue(var.IsValid()) + self.assertEqual(var.GetNumChildren(), size) + for i in range(size): + child = var.GetChildAtIndex(i) + self.assertEqual(child.GetValueAsUnsigned(), self.primes[i], + "variable: %s, index: %d"%(name, size)) + + @add_test_categories(["libc++"]) + def test(self): + """Test that std::bitset is displayed correctly""" + self.build() + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.cpp", False)) + + self.check("empty", 0) + self.check("small", 13) + self.check("large", 200) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp new file mode 100644 index 0000000000000..a80f97b801571 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp @@ -0,0 +1,20 @@ +#include <bitset> + +template<std::size_t N> +void fill(std::bitset<N> &b) { + b.set(); + b[0] = b[1] = false; + for (std::size_t i = 2; i < N; ++i) { + for (std::size_t j = 2*i; j < N; j+=i) + b[j] = false; + } +} + +int main() { + std::bitset<0> empty; + std::bitset<13> small; + fill(small); + std::bitset<200> large; + fill(large); + return 0; // break here +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/Makefile new file mode 100644 index 0000000000000..bf75013f531d2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../../../make + +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py new file mode 100644 index 0000000000000..1cc454a473a8a --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/TestDataFormatterLibcxxForwardList.py @@ -0,0 +1,53 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestDataFormatterLibcxxForwardList(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + TestBase.setUp(self) + self.line = line_number('main.cpp', '// break here') + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + @add_test_categories(["libc++"]) + def test(self): + """Test that std::forward_list is displayed correctly""" + self.build() + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.cpp", False)) + + forward_list = self.namespace + '::forward_list' + self.expect("frame variable empty", + substrs=[forward_list, + 'size=0', + '{}']) + + self.expect("frame variable one_elt", + substrs=[forward_list, + 'size=1', + '{', + '[0] = 47', + '}']) + + self.expect("frame variable five_elts", + substrs=[forward_list, + 'size=5', + '{', + '[0] = 1', + '[1] = 22', + '[2] = 333', + '[3] = 4444', + '[4] = 55555', + '}']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/main.cpp new file mode 100644 index 0000000000000..73abda6e82e56 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/forward_list/main.cpp @@ -0,0 +1,7 @@ +#include <forward_list> + +int main() +{ + std::forward_list<int> empty{}, one_elt{47}, five_elts{1,22,333,4444,55555}; + return 0; // break here +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile new file mode 100644 index 0000000000000..bf75013f531d2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../../../make + +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py new file mode 100644 index 0000000000000..2b157f7f6fccc --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py @@ -0,0 +1,43 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestDataFormatterLibcxxQueue(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + TestBase.setUp(self) + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + def check_variable(self, name): + var = self.frame().FindVariable(name) + self.assertTrue(var.IsValid()) + + queue = self.namespace + '::queue' + self.assertTrue(queue in var.GetTypeName()) + self.assertEqual(var.GetNumChildren(), 5) + for i in range(5): + ch = var.GetChildAtIndex(i) + self.assertTrue(ch.IsValid()) + self.assertEqual(ch.GetValueAsSigned(), i+1) + + @add_test_categories(["libc++"]) + def test(self): + """Test that std::queue is displayed correctly""" + self.build() + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.cpp", False)) + + self.check_variable('q1') + self.check_variable('q2') diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp new file mode 100644 index 0000000000000..449be8d99cf6e --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/main.cpp @@ -0,0 +1,11 @@ +#include <queue> +#include <vector> + +using namespace std; + +int main() { + queue<int> q1{{1,2,3,4,5}}; + queue<int, std::vector<int>> q2{{1,2,3,4,5}}; + int ret = q1.size() + q2.size(); // break here + return ret; +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile new file mode 100644 index 0000000000000..bf75013f531d2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../../../make + +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 +include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py new file mode 100644 index 0000000000000..b25540056a24d --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/TestDataFormatterLibcxxTuple.py @@ -0,0 +1,51 @@ +""" +Test lldb data formatter subsystem. +""" + +from __future__ import print_function + + +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class TestDataFormatterLibcxxTuple(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + def setUp(self): + TestBase.setUp(self) + self.line = line_number('main.cpp', '// break here') + ns = 'ndk' if lldbplatformutil.target_is_android() else '' + self.namespace = 'std::__' + ns + '1' + + @add_test_categories(["libc++"]) + def test(self): + """Test that std::tuple is displayed correctly""" + self.build() + lldbutil.run_to_source_breakpoint(self, '// break here', + lldb.SBFileSpec("main.cpp", False)) + + tuple_name = self.namespace + '::tuple' + self.expect("frame variable empty", + substrs=[tuple_name, + 'size=0', + '{}']) + + self.expect("frame variable one_elt", + substrs=[tuple_name, + 'size=1', + '{', + '[0] = 47', + '}']) + + self.expect("frame variable three_elts", + substrs=[tuple_name, + 'size=3', + '{', + '[0] = 1', + '[1] = 47', + '[2] = "foo"', + '}']) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp new file mode 100644 index 0000000000000..1c0d0f2ae7744 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/tuple/main.cpp @@ -0,0 +1,11 @@ +#include <tuple> +#include <string> + +using namespace std; + +int main() { + tuple<> empty; + tuple<int> one_elt{47}; + tuple<int, long, string> three_elts{1, 47l, "foo"}; + return 0; // break here +} diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/Makefile index 7fe01d004f03c..2e8bcb9079bdf 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/Makefile @@ -5,11 +5,4 @@ CXX_SOURCES := main.cpp CFLAGS_EXTRAS += -O0 USE_LIBSTDCPP := 1 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py index ce5087dbc2888..90a958d7cfe2c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py @@ -24,6 +24,7 @@ class StdIteratorDataFormatterTestCase(TestBase): self.line = line_number('main.cpp', '// Set break point at this line.') @skipIfWindows # libstdcpp not ported to Windows + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): """Test that libstdcpp iterators format properly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/Makefile index 7fe01d004f03c..2e8bcb9079bdf 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/Makefile @@ -5,11 +5,4 @@ CXX_SOURCES := main.cpp CFLAGS_EXTRAS += -O0 USE_LIBSTDCPP := 1 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py index a7f8c4b1e174b..a8f99f41665f0 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py @@ -28,6 +28,7 @@ class StdListDataFormatterTestCase(TestBase): 'main.cpp', '// Set final break point at this line.') @skipIfWindows # libstdcpp not ported to Windows + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/Makefile index 2c6c3cf728421..17868d8a95fc7 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/Makefile @@ -4,11 +4,4 @@ CXX_SOURCES := main.cpp USE_LIBSTDCPP := 1 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py index cdaec8392fe08..e25c410f91ce1 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py @@ -25,6 +25,7 @@ class StdMapDataFormatterTestCase(TestBase): @skipIfWindows # libstdcpp not ported to Windows @skipIfFreeBSD + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile index 88cb026aba1cd..63f2aaf9c75a4 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile @@ -5,11 +5,4 @@ CXX_SOURCES := main.cpp CXXFLAGS := -O0 USE_LIBSTDCPP := 1 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py index 8d940c2686a00..6809dd3c356d1 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py @@ -18,6 +18,7 @@ class StdSmartPtrDataFormatterTestCase(TestBase): @skipIfFreeBSD @skipIfWindows # libstdcpp not ported to Windows @skipIfDarwin # doesn't compile on Darwin + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/Makefile index 7fe01d004f03c..2e8bcb9079bdf 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/Makefile @@ -5,11 +5,4 @@ CXX_SOURCES := main.cpp CFLAGS_EXTRAS += -O0 USE_LIBSTDCPP := 1 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py index 67823c95f1382..d4e9e4d30f77f 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py @@ -25,6 +25,7 @@ class StdStringDataFormatterTestCase(TestBase): self.line = line_number('main.cpp', '// Set break point at this line.') @skipIfWindows # libstdcpp not ported to Windows + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile index beb2fd583e7a1..17868d8a95fc7 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/Makefile @@ -3,6 +3,5 @@ LEVEL = ../../../../../make CXX_SOURCES := main.cpp USE_LIBSTDCPP := 1 -CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS) include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py index 56e231da85223..b38747d0f9372 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py @@ -18,6 +18,7 @@ class StdTupleDataFormatterTestCase(TestBase): @skipIfFreeBSD @skipIfWindows # libstdcpp not ported to Windows @skipIfDarwin # doesn't compile on Darwin + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile index beb2fd583e7a1..17868d8a95fc7 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/Makefile @@ -3,6 +3,5 @@ LEVEL = ../../../../../make CXX_SOURCES := main.cpp USE_LIBSTDCPP := 1 -CFLAGS_EXTRAS += $(NO_LIMIT_DEBUG_INFO_FLAGS) include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py index 37adb28d7d591..23da541120f6c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py @@ -18,6 +18,7 @@ class StdUniquePtrDataFormatterTestCase(TestBase): @skipIfFreeBSD @skipIfWindows # libstdcpp not ported to Windows @skipIfDarwin # doesn't compile on Darwin + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): self.build() self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) @@ -67,6 +68,7 @@ class StdUniquePtrDataFormatterTestCase(TestBase): @skipIfFreeBSD @skipIfWindows # libstdcpp not ported to Windows @skipIfDarwin # doesn't compile on Darwin + @skipIfwatchOS # libstdcpp not ported to watchos def test_recursive_unique_ptr(self): # Tests that LLDB can handle when we have a loop in the unique_ptr # reference chain and that it correctly handles the different options diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py index 17b369df3e6bb..57c9e2fe5dc79 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py @@ -28,6 +28,7 @@ class StdVBoolDataFormatterTestCase(TestBase): bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot') @skipIfWindows # libstdcpp not ported to Windows. @skipIfDarwin + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/Makefile index 88cb026aba1cd..63f2aaf9c75a4 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/Makefile @@ -5,11 +5,4 @@ CXX_SOURCES := main.cpp CXXFLAGS := -O0 USE_LIBSTDCPP := 1 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py index e4ec703495b34..e3f21eb21ec0c 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py @@ -25,6 +25,7 @@ class StdVectorDataFormatterTestCase(TestBase): @skipIfFreeBSD @skipIfWindows # libstdcpp not ported to Windows + @skipIfwatchOS # libstdcpp not ported to watchos def test_with_run_command(self): """Test that that file and class static variables display correctly.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/Makefile index 04f39271f0cd7..314f1cb2f077b 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/Makefile index 69dde1b76184a..872bf6d208770 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp CXXFLAGS += -std=c++11 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/Makefile index 69dde1b76184a..872bf6d208770 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp CXXFLAGS += -std=c++11 -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Makefile index 04f39271f0cd7..314f1cb2f077b 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/Makefile index 18c35a7d84a51..314f1cb2f077b 100644 --- a/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/Makefile @@ -2,10 +2,4 @@ LEVEL = ../../../make CXX_SOURCES := main.cpp -# Workaround for llvm.org/pr16214: clang doesn't emit structure definition DWARF -# information without the flag below. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py index e5d81d8cefc09..cee472ccb51fa 100644 --- a/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py @@ -45,7 +45,7 @@ class DisassemblyTestCase(TestBase): if arch in ["", 'x86_64', 'i386', 'i686']: breakpoint_opcodes = ["int3"] instructions = [' mov', ' addl ', 'ret'] - elif arch in ["arm", "aarch64"]: + elif arch in ["arm", "aarch64", "arm64", "armv7", "armv7k"]: breakpoint_opcodes = ["brk", "udf"] instructions = [' add ', ' ldr ', ' str '] elif re.match("mips", arch): diff --git a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py index 65271c3894b8d..965af3e4910a1 100644 --- a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py +++ b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py @@ -24,11 +24,23 @@ def execute_command(command): class ExecTestCase(TestBase): + NO_DEBUG_INFO_TESTCASE = True + mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") - def test(self): + @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems + def test_hitting_exec (self): + self.do_test(False) + + @skipUnlessDarwin + @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") + @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems + def test_skipping_exec (self): + self.do_test(False) + + def do_test(self, skip_exec): if self.getArchitecture() == 'x86_64': source = os.path.join(os.getcwd(), "main.cpp") o_file = os.path.join(os.getcwd(), "main.o") @@ -59,6 +71,16 @@ class ExecTestCase(TestBase): None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) + if skip_exec: + self.debugger.HandleCommand("settings set target.process.stop-on-exec false") + def cleanup(): + self.runCmd("settings set target.process.stop-on-exec false", + check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + for i in range(6): # The stop reason of the thread should be breakpoint. self.assertTrue(process.GetState() == lldb.eStateStopped, @@ -83,19 +105,25 @@ class ExecTestCase(TestBase): # Run and we should stop due to exec process.Continue() - self.assertTrue(process.GetState() == lldb.eStateStopped, - "Process should be stopped at __dyld_start") + if not skip_exec: + self.assertTrue(process.GetState() == lldb.eStateStopped, + "Process should be stopped at __dyld_start") + + threads = lldbutil.get_stopped_threads( + process, lldb.eStopReasonExec) + self.assertTrue( + len(threads) == 1, + "We got a thread stopped for exec.") - threads = lldbutil.get_stopped_threads( - process, lldb.eStopReasonExec) - self.assertTrue( - len(threads) == 1, - "We got a thread stopped for exec.") - - # Run and we should stop at breakpoint in main after exec - process.Continue() + # Run and we should stop at breakpoint in main after exec + process.Continue() threads = lldbutil.get_threads_stopped_at_breakpoint( process, breakpoint) + if self.TraceOn(): + for t in process.threads: + print(t) + if t.GetStopReason() != lldb.eStopReasonBreakpoint: + self.runCmd("bt") self.assertTrue(len(threads) == 1, "Stopped at breakpoint in exec'ed process.") diff --git a/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py index 21d4357a6ff1e..719f3f7199344 100644 --- a/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py +++ b/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py @@ -16,15 +16,13 @@ from lldbsuite.test import lldbutil class ExprDoesntDeadlockTestCase(TestBase): - def getCategories(self): - return ['basic_process'] - mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr17946') @expectedFailureAll( oslist=["windows"], bugnumber="Windows doesn't have pthreads, test needs to be ported") + @add_test_categories(["basic_process"]) def test_with_run_command(self): """Test that expr will time out and allow other threads to run if it blocks.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py index 46264f3dfe8d0..276760d305744 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py @@ -15,6 +15,7 @@ class TestArray(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_array(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py index dd8ff949fa98d..6529e11fafa89 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py @@ -15,6 +15,7 @@ class TestBadReference(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_bad_reference(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py index a8708169bb3bf..2e6fad5e1fdb2 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py @@ -15,6 +15,7 @@ class TestDiagnoseDereferenceArgument(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_diagnose_dereference_argument(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py index 80128eec1f7ee..7839a47a8f411 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py @@ -15,6 +15,7 @@ class TestDiagnoseDereferenceArgument(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_diagnose_dereference_argument(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py index 5e097afdc9b6c..8e5cd430293d2 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py @@ -15,6 +15,7 @@ class TestDiagnoseDereferenceFunctionReturn(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 @expectedFailureAll(oslist=['macosx'], archs=['i386'], bugnumber="rdar://28656408") def test_diagnose_dereference_function_return(self): TestBase.setUp(self) diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py index 233c9e403bd20..201923fb89d60 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py @@ -15,6 +15,7 @@ class TestDiagnoseDereferenceThis(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_diagnose_dereference_this(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py index 267223ad0854c..08ef1c7fc5e6a 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py @@ -15,6 +15,7 @@ class TestDiagnoseInheritance(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_diagnose_inheritance(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py index a1a17c941760b..e962c2673faf8 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py @@ -15,6 +15,7 @@ class TestLocalVariable(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_local_variable(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py index adf092d86157a..bc11bd1afb78c 100644 --- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py +++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py @@ -15,6 +15,7 @@ class TestDiagnoseVirtualMethodCall(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64 def test_diagnose_virtual_method_call(self): TestBase.setUp(self) self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py index d058b1cac560f..b233d2f768e0f 100644 --- a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -17,9 +17,6 @@ class CrashingInferiorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAll( - oslist=['freebsd'], - bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not signal") - @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API") def test_inferior_crashing(self): @@ -60,7 +57,6 @@ class CrashingInferiorTestCase(TestBase): self.build() self.inferior_crashing_step() - @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24939') @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24778, This actually works, but the test relies on the output format instead of the API") @@ -76,6 +72,7 @@ class CrashingInferiorTestCase(TestBase): # Inferior exits after stepping after a segfault. This is working as # intended IMHO. @skipIfLinux + @skipIfFreeBSD def test_inferior_crashing_expr_step_and_expr(self): """Test that lldb expressions work before and after stepping after a crash.""" self.build() @@ -110,7 +107,7 @@ class CrashingInferiorTestCase(TestBase): # The exact stop reason depends on the platform if self.platformIsDarwin(): stop_reason = 'stop reason = EXC_BAD_ACCESS' - elif self.getPlatform() == "linux": + elif self.getPlatform() == "linux" or self.getPlatform() == "freebsd": stop_reason = 'stop reason = signal SIGSEGV' else: stop_reason = 'stop reason = invalid address' diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py index f04173a3e8d2b..9987377a83ec7 100644 --- a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -16,9 +16,6 @@ class CrashingRecursiveInferiorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @expectedFailureAll( - oslist=['freebsd'], - bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not signal") @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") def test_recursive_inferior_crashing(self): """Test that lldb reliably catches the inferior crashing (command).""" @@ -50,7 +47,6 @@ class CrashingRecursiveInferiorTestCase(TestBase): self.build() self.recursive_inferior_crashing_step() - @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr24939') @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") @skipIfTargetAndroid() # debuggerd interferes with this test on Android def test_recursive_inferior_crashing_step_after_break(self): @@ -61,6 +57,7 @@ class CrashingRecursiveInferiorTestCase(TestBase): # Inferior exits after stepping after a segfault. This is working as # intended IMHO. @skipIfLinux + @skipIfFreeBSD @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") def test_recursive_inferior_crashing_expr_step_and_expr(self): """Test that lldb expressions work before and after stepping after a crash.""" @@ -94,7 +91,7 @@ class CrashingRecursiveInferiorTestCase(TestBase): # The exact stop reason depends on the platform if self.platformIsDarwin(): stop_reason = 'stop reason = EXC_BAD_ACCESS' - elif self.getPlatform() == "linux": + elif self.getPlatform() == "linux" or self.getPlatform() == "freebsd": stop_reason = 'stop reason = signal SIGSEGV' else: stop_reason = 'stop reason = invalid address' diff --git a/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py index 0ebb99d3fd43c..43fa5f9d33f24 100644 --- a/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py +++ b/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py @@ -22,6 +22,7 @@ class LaunchWithShellExpandTestCase(TestBase): "linux", "freebsd"], bugnumber="llvm.org/pr24778 llvm.org/pr22627") + @skipIfDarwinEmbedded # iOS etc don't launch the binary via a shell, so arg expansion won't happen def test(self): self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/.categories b/packages/Python/lldbsuite/test/functionalities/load_unload/.categories new file mode 100644 index 0000000000000..c00c25822e4c2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/load_unload/.categories @@ -0,0 +1 @@ +basic_process diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile b/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile index 779745c4d26ca..9a954a201cf2b 100644 --- a/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -8,11 +8,17 @@ CXX_SOURCES := main.cpp include $(LEVEL)/Makefile.rules .PHONY: -a.out: lib_a lib_b lib_c lib_d hidden_lib_d +a.out: lib_a lib_b lib_c lib_d hidden_lib_d install_name_tool lib_%: $(MAKE) -f $*.mk +install_name_tool: +ifeq ($(OS),Darwin) + install_name_tool -id @executable_path/libloadunload_d.dylib libloadunload_d.dylib +endif + + hidden_lib_d: $(MAKE) -C hidden diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py b/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py index 027968a727f1f..98b0c9ca19715 100644 --- a/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py +++ b/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py @@ -17,9 +17,6 @@ from lldbsuite.test import lldbutil @skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently class LoadUnloadTestCase(TestBase): - def getCategories(self): - return ['basic_process'] - mydir = TestBase.compute_mydir(__file__) def setUp(self): @@ -56,10 +53,14 @@ class LoadUnloadTestCase(TestBase): Does nothing in case of non-remote platforms. """ if lldb.remote_platform: - cwd = os.getcwd() - shlibs = ['libloadunload_a.so', 'libloadunload_b.so', - 'libloadunload_c.so', 'libloadunload_d.so'] + ext = 'so' + if self.platformIsDarwin(): + ext = 'dylib' + + shlibs = ['libloadunload_a.' + ext, 'libloadunload_b.' + ext, + 'libloadunload_c.' + ext, 'libloadunload_d.' + ext] wd = lldb.remote_platform.GetWorkingDirectory() + cwd = os.getcwd() for f in shlibs: err = lldb.remote_platform.Put( lldb.SBFileSpec(os.path.join(cwd, f)), @@ -69,7 +70,7 @@ class LoadUnloadTestCase(TestBase): "Unable copy '%s' to '%s'.\n>>> %s" % (f, wd, err.GetCString())) if hidden_dir: - shlib = 'libloadunload_d.so' + shlib = 'libloadunload_d.' + ext hidden_dir = os.path.join(wd, 'hidden') hidden_file = os.path.join(hidden_dir, shlib) err = lldb.remote_platform.MakeDirectory(hidden_dir) diff --git a/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py b/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py index 6a779ecfac5b2..eb6981d04fad9 100644 --- a/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py +++ b/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py @@ -17,6 +17,7 @@ class MTCSimpleTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin + @skipIfDarwinEmbedded # Test file depends on AppKit which is not present on iOS etc. def test(self): self.mtc_dylib_path = findMainThreadCheckerDylib() if self.mtc_dylib_path == "": @@ -29,6 +30,7 @@ class MTCSimpleTestCase(TestBase): # Call super's setUp(). TestBase.setUp(self) + @skipIf(archs=['i386']) def mtc_tests(self): # Load the test exe = os.path.join(os.getcwd(), "a.out") diff --git a/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py b/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py new file mode 100644 index 0000000000000..54ea33ad24a9e --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py @@ -0,0 +1,76 @@ +""" +Test the lldb platform Python API. +""" + +from __future__ import print_function + + +import os +import time +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class PlatformPythonTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @add_test_categories(['pyapi']) + @no_debug_info_test + def test_platform_list(self): + """Test SBDebugger::GetNumPlatforms() & GetPlatformAtIndex() API""" + # Verify the host platform is present by default. + initial_num_platforms = self.dbg.GetNumPlatforms() + self.assertGreater(initial_num_platforms, 0) + host_platform = self.dbg.GetPlatformAtIndex(0) + self.assertTrue(host_platform.IsValid() and + host_platform.GetName() == 'host', + 'The host platform is present') + # Select another platform and verify that the platform is added to + # the platform list. + platform_idx = self.dbg.GetNumAvailablePlatforms() - 1 + if platform_idx < 1: + self.fail('No platforms other than host are available') + platform_data = self.dbg.GetAvailablePlatformInfoAtIndex(platform_idx) + platform_name = platform_data.GetValueForKey('name').GetStringValue(100) + self.assertNotEqual(platform_name, 'host') + self.dbg.SetCurrentPlatform(platform_name) + selected_platform = self.dbg.GetSelectedPlatform() + self.assertTrue(selected_platform.IsValid()) + self.assertEqual(selected_platform.GetName(), platform_name) + self.assertEqual(self.dbg.GetNumPlatforms(), initial_num_platforms + 1) + platform_found = False + for platform_idx in range(self.dbg.GetNumPlatforms()): + platform = self.dbg.GetPlatformAtIndex(platform_idx) + if platform.GetName() == platform_name: + platform_found = True + break + self.assertTrue(platform_found) + + @add_test_categories(['pyapi']) + @no_debug_info_test + def test_available_platform_list(self): + """Test SBDebugger::GetNumAvailablePlatforms() and GetAvailablePlatformInfoAtIndex() API""" + num_platforms = self.dbg.GetNumAvailablePlatforms() + self.assertGreater( + num_platforms, 0, + 'There should be at least one platform available') + + for i in range(num_platforms): + platform_data = self.dbg.GetAvailablePlatformInfoAtIndex(i) + name_data = platform_data.GetValueForKey('name') + desc_data = platform_data.GetValueForKey('description') + self.assertTrue( + name_data and name_data.IsValid(), + 'Platform has a name') + self.assertEqual( + name_data.GetType(), lldb.eStructuredDataTypeString, + 'Platform name is a string') + self.assertTrue( + desc_data and desc_data.IsValid(), + 'Platform has a description') + self.assertEqual( + desc_data.GetType(), lldb.eStructuredDataTypeString, + 'Platform description is a string') diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py index 18c0da832606e..63b93340cef35 100644 --- a/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py +++ b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py @@ -24,11 +24,13 @@ class LinuxCoreTestCase(TestBase): _mips64_n64_pid = 25619 _mips64_n32_pid = 3670 _mips_o32_pid = 3532 + _ppc64le_pid = 28147 _i386_regions = 4 _x86_64_regions = 5 _s390x_regions = 2 _mips_regions = 5 + _ppc64le_regions = 2 def setUp(self): super(LinuxCoreTestCase, self).setUp() @@ -58,6 +60,12 @@ class LinuxCoreTestCase(TestBase): @skipIf(oslist=['windows']) @skipIf(triple='^mips') + def test_ppc64le(self): + """Test that lldb can read the process information from an ppc64le linux core file.""" + self.do_test("linux-ppc64le", self._ppc64le_pid, self._ppc64le_regions) + + @skipIf(oslist=['windows']) + @skipIf(triple='^mips') def test_x86_64(self): """Test that lldb can read the process information from an x86_64 linux core file.""" self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions) @@ -137,7 +145,7 @@ class LinuxCoreTestCase(TestBase): values = {} values["fctrl"] = "0x037f" values["fstat"] = "0x0000" - values["ftag"] = "0xff" + values["ftag"] = "0x00ff" values["fop"] = "0x0000" values["fiseg"] = "0x00000000" values["fioff"] = "0x0040011e" @@ -244,6 +252,34 @@ class LinuxCoreTestCase(TestBase): end_region.GetRegionBase()) self.assertEqual(end_region.GetRegionEnd(), lldb.LLDB_INVALID_ADDRESS) + def check_state(self, process): + with open(os.devnull) as devnul: + # sanitize test output + self.dbg.SetOutputFileHandle(devnul, False) + self.dbg.SetErrorFileHandle(devnul, False) + + self.assertTrue(process.is_stopped) + + # Process.Continue + error = process.Continue() + self.assertFalse(error.Success()) + self.assertTrue(process.is_stopped) + + # Thread.StepOut + thread = process.GetSelectedThread() + thread.StepOut() + self.assertTrue(process.is_stopped) + + # command line + self.dbg.HandleCommand('s') + self.assertTrue(process.is_stopped) + self.dbg.HandleCommand('c') + self.assertTrue(process.is_stopped) + + # restore file handles + self.dbg.SetOutputFileHandle(None, False) + self.dbg.SetErrorFileHandle(None, False) + def do_test(self, filename, pid, region_count): target = self.dbg.CreateTarget(filename + ".out") process = target.LoadCore(filename + ".core") @@ -251,6 +287,8 @@ class LinuxCoreTestCase(TestBase): self.assertEqual(process.GetNumThreads(), 1) self.assertEqual(process.GetProcessID(), pid) + self.check_state(process) + thread = process.GetSelectedThread() self.assertTrue(thread) self.assertEqual(thread.GetThreadID(), pid) diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core Binary files differnew file mode 100644 index 0000000000000..c0ed578bd7965 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.core diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out Binary files differnew file mode 100755 index 0000000000000..05c69fd291b74 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/linux-ppc64le.out diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py index 9becd8756318a..178bb678df7c0 100644 --- a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py +++ b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py @@ -31,6 +31,34 @@ class MiniDumpNewTestCase(TestBase): lldb.DBG.SetSelectedPlatform(self._initial_platform) super(MiniDumpNewTestCase, self).tearDown() + def check_state(self): + with open(os.devnull) as devnul: + # sanitize test output + self.dbg.SetOutputFileHandle(devnul, False) + self.dbg.SetErrorFileHandle(devnul, False) + + self.assertTrue(self.process.is_stopped) + + # Process.Continue + error = self.process.Continue() + self.assertFalse(error.Success()) + self.assertTrue(self.process.is_stopped) + + # Thread.StepOut + thread = self.process.GetSelectedThread() + thread.StepOut() + self.assertTrue(self.process.is_stopped) + + # command line + self.dbg.HandleCommand('s') + self.assertTrue(self.process.is_stopped) + self.dbg.HandleCommand('c') + self.assertTrue(self.process.is_stopped) + + # restore file handles + self.dbg.SetOutputFileHandle(None, False) + self.dbg.SetErrorFileHandle(None, False) + def test_process_info_in_minidump(self): """Test that lldb can read the process information from the Minidump.""" # target create -c linux-x86_64.dmp @@ -40,6 +68,7 @@ class MiniDumpNewTestCase(TestBase): self.assertTrue(self.process, PROCESS_IS_VALID) self.assertEqual(self.process.GetNumThreads(), 1) self.assertEqual(self.process.GetProcessID(), self._linux_x86_64_pid) + self.check_state() def test_thread_info_in_minidump(self): """Test that lldb can read the thread information from the Minidump.""" @@ -47,6 +76,7 @@ class MiniDumpNewTestCase(TestBase): self.dbg.CreateTarget(None) self.target = self.dbg.GetSelectedTarget() self.process = self.target.LoadCore("linux-x86_64.dmp") + self.check_state() # This process crashed due to a segmentation fault in its # one and only thread. self.assertEqual(self.process.GetNumThreads(), 1) @@ -61,6 +91,7 @@ class MiniDumpNewTestCase(TestBase): self.dbg.CreateTarget("linux-x86_64") self.target = self.dbg.GetSelectedTarget() self.process = self.target.LoadCore("linux-x86_64.dmp") + self.check_state() self.assertEqual(self.process.GetNumThreads(), 1) self.assertEqual(self.process.GetProcessID(), self._linux_x86_64_pid) thread = self.process.GetThreadAtIndex(0) @@ -81,6 +112,7 @@ class MiniDumpNewTestCase(TestBase): self.dbg.CreateTarget(None) self.target = self.dbg.GetSelectedTarget() self.process = self.target.LoadCore("linux-x86_64_not_crashed.dmp") + self.check_state() self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) self.assertEqual(thread.GetStopReason(), lldb.eStopReasonNone) @@ -161,9 +193,10 @@ class MiniDumpNewTestCase(TestBase): """Test that we can examine local variables in a Minidump.""" # Launch with the Minidump, and inspect a local variable. # target create linux-x86_64_not_crashed -c linux-x86_64_not_crashed.dmp - target = self.dbg.CreateTarget("linux-x86_64_not_crashed") - process = target.LoadCore("linux-x86_64_not_crashed.dmp") - thread = process.GetThreadAtIndex(0) + self.target = self.dbg.CreateTarget("linux-x86_64_not_crashed") + self.process = self.target.LoadCore("linux-x86_64_not_crashed.dmp") + self.check_state() + thread = self.process.GetThreadAtIndex(0) frame = thread.GetFrameAtIndex(1) value = frame.EvaluateExpression('x') self.assertEqual(value.GetValueAsSigned(), 3) diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py index b89a305d0e885..c7b64d783c713 100644 --- a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py +++ b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py @@ -41,6 +41,7 @@ class MiniDumpTestCase(TestBase): stop_description = thread.GetStopDescription(256) self.assertTrue("0xc0000005" in stop_description) + @expectedFailureAll(bugnumber="llvm.org/pr35193", hostoslist=["windows"]) def test_stack_info_in_mini_dump(self): """Test that we can see a trivial stack in a VS-generate mini dump.""" # target create -c fizzbuzz_no_heap.dmp @@ -49,14 +50,14 @@ class MiniDumpTestCase(TestBase): self.process = self.target.LoadCore("fizzbuzz_no_heap.dmp") self.assertEqual(self.process.GetNumThreads(), 1) thread = self.process.GetThreadAtIndex(0) - # The crash is in main, so there should be one frame on the stack. - self.assertEqual(thread.GetNumFrames(), 1) - frame = thread.GetFrameAtIndex(0) - self.assertTrue(frame.IsValid()) - pc = frame.GetPC() - eip = frame.FindRegister("pc") - self.assertTrue(eip.IsValid()) - self.assertEqual(pc, eip.GetValueAsUnsigned()) + + pc_list = [ 0x00164d14, 0x00167c79, 0x00167e6d, 0x7510336a, 0x77759882, 0x77759855] + + self.assertEqual(thread.GetNumFrames(), len(pc_list)) + for i in range(len(pc_list)): + frame = thread.GetFrameAtIndex(i) + self.assertTrue(frame.IsValid()) + self.assertEqual(frame.GetPC(), pc_list[i]) @skipUnlessWindows # Minidump saving works only on windows def test_deeper_stack_in_mini_dump(self): diff --git a/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py b/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py index 716d0d4f5bc75..c4d372cd3d301 100644 --- a/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py +++ b/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py @@ -8,6 +8,7 @@ from __future__ import print_function import os import time import lldb +import shutil from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil @@ -22,6 +23,7 @@ class ProcessAttachTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True @skipIfiOSSimulator + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails def test_attach_to_process_by_id(self): """Test attach by process id""" self.build() @@ -38,6 +40,34 @@ class ProcessAttachTestCase(TestBase): process = target.GetProcess() self.assertTrue(process, PROCESS_IS_VALID) + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails + def test_attach_to_process_from_different_dir_by_id(self): + """Test attach by process id""" + try: + os.mkdir(os.path.join(os.getcwd(),'newdir')) + except OSError, e: + if e.errno != os.errno.EEXIST: + raise + testdir = os.getcwd() + newdir = os.path.join(testdir,'newdir') + exe = os.path.join(newdir, 'proc_attach') + self.buildProgram('main.cpp', exe) + self.addTearDownHook(lambda: shutil.rmtree(newdir)) + + # Spawn a new process + popen = self.spawnSubprocess(exe) + self.addTearDownHook(self.cleanupSubprocesses) + + os.chdir('newdir') + self.addTearDownHook(lambda: os.chdir(testdir)) + self.runCmd("process attach -p " + str(popen.pid)) + + target = self.dbg.GetSelectedTarget() + + process = target.GetProcess() + self.assertTrue(process, PROCESS_IS_VALID) + + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails def test_attach_to_process_by_name(self): """Test attach by process name""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py index 071f5d57c78f7..5465b7155f501 100644 --- a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py +++ b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py @@ -21,6 +21,7 @@ class AttachDeniedTestCase(TestBase): @skipIfWindows @skipIfiOSSimulator + @skipIfDarwinEmbedded # ptrace(ATTACH_REQUEST...) won't work on ios/tvos/etc def test_attach_to_process_by_id_denied(self): """Test attach by process id denied""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py b/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py index 00b4d4153403c..91436446ad990 100644 --- a/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py +++ b/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py @@ -23,6 +23,7 @@ class ChangeProcessGroupTestCase(TestBase): @skipIfFreeBSD # Times out on FreeBSD llvm.org/pr23731 @skipIfWindows # setpgid call does not exist on Windows @expectedFailureAndroid("http://llvm.org/pr23762", api_levels=[16]) + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails def test_setpgid(self): self.build() exe = os.path.join(os.getcwd(), 'a.out') diff --git a/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py b/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py index fe6ce2c25a3ef..83cc48847c994 100644 --- a/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py +++ b/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py @@ -45,7 +45,7 @@ class RegisterCommandsTestCase(TestBase): self.runCmd("register read xmm0") self.runCmd("register read ymm15") # may be available self.runCmd("register read bnd0") # may be available - elif self.getArchitecture() in ['arm']: + elif self.getArchitecture() in ['arm', 'armv7', 'armv7k', 'arm64']: self.runCmd("register read s0") self.runCmd("register read q15") # may be available @@ -84,7 +84,10 @@ class RegisterCommandsTestCase(TestBase): if self.getArchitecture() in ['amd64', 'i386', 'x86_64']: gpr = "eax" vector = "xmm0" - elif self.getArchitecture() in ['arm']: + elif self.getArchitecture() in ['arm64', 'aarch64']: + gpr = "w0" + vector = "v0" + elif self.getArchitecture() in ['arm', 'armv7', 'armv7k']: gpr = "r0" vector = "q0" @@ -269,14 +272,18 @@ class RegisterCommandsTestCase(TestBase): target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) - lldbutil.run_break_set_by_symbol( - self, "main", num_expected_locations=-1) - - # Launch the process, and do not stop at the entry point. - process = target.LaunchSimple( - None, None, self.get_process_working_directory()) + # Launch the process, stop at the entry point. + error = lldb.SBError() + process = target.Launch( + lldb.SBListener(), + None, None, # argv, envp + None, None, None, # stdin/out/err + self.get_process_working_directory(), + 0, # launch flags + True, # stop at entry + error) + self.assertTrue(error.Success(), "Launch succeeds. Error is :" + str(error)) - process = target.GetProcess() self.assertTrue( process.GetState() == lldb.eStateStopped, PROCESS_STOPPED) @@ -317,7 +324,35 @@ class RegisterCommandsTestCase(TestBase): ("xmm15", "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x0e 0x0f}", False)) - elif self.getArchitecture() in ['arm']: + elif self.getArchitecture() in ['arm64', 'aarch64']: + reg_list = [ + # reg value + # must-have + ("fpsr", "0xfbf79f9f", True), + ("s0", "1.25", True), + ("s31", "0.75", True), + ("d1", "123", True), + ("d17", "987", False), + ("v1", "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f}", True), + ("v14", + "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x0e 0x0f}", + False), + ] + elif self.getArchitecture() in ['armv7'] and self.platformIsDarwin(): + reg_list = [ + # reg value + # must-have + ("fpsr", "0xfbf79f9f", True), + ("s0", "1.25", True), + ("s31", "0.75", True), + ("d1", "123", True), + ("d17", "987", False), + ("q1", "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x2f 0x2f}", True), + ("q14", + "{0x01 0x02 0x03 0x00 0x00 0x00 0x00 0x00 0x09 0x0a 0x2f 0x2f 0x2f 0x2f 0x0e 0x0f}", + False), + ] + elif self.getArchitecture() in ['arm', 'armv7k']: reg_list = [ # reg value # must-have diff --git a/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py b/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py index 1750bd31b3df6..606a71ff50197 100644 --- a/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py +++ b/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py @@ -22,6 +22,10 @@ class ReturnValueTestCase(TestBase): return ("clang" in self.getCompiler() and self.getArchitecture() == "aarch64" and self.getPlatform() == "linux") + # ABIMacOSX_arm can't fetch simple values inside a structure + def affected_by_radar_34562999(self): + return (self.getArchitecture() == 'armv7' or self.getArchitecture() == 'armv7k') and self.platformIsDarwin() + @expectedFailureAll(oslist=["freebsd"], archs=["i386"]) @expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="<rdar://problem/28719652>") @expectedFailureAll( @@ -142,33 +146,34 @@ class ReturnValueTestCase(TestBase): #self.assertTrue(in_float == return_float) - self.return_and_test_struct_value("return_one_int") - self.return_and_test_struct_value("return_two_int") - self.return_and_test_struct_value("return_three_int") - self.return_and_test_struct_value("return_four_int") - if not self.affected_by_pr33042(): - self.return_and_test_struct_value("return_five_int") - - self.return_and_test_struct_value("return_two_double") - self.return_and_test_struct_value("return_one_double_two_float") - self.return_and_test_struct_value("return_one_int_one_float_one_int") - - self.return_and_test_struct_value("return_one_pointer") - self.return_and_test_struct_value("return_two_pointer") - self.return_and_test_struct_value("return_one_float_one_pointer") - self.return_and_test_struct_value("return_one_int_one_pointer") - self.return_and_test_struct_value("return_three_short_one_float") - - self.return_and_test_struct_value("return_one_int_one_double") - self.return_and_test_struct_value("return_one_int_one_double_one_int") - self.return_and_test_struct_value( - "return_one_short_one_double_one_short") - self.return_and_test_struct_value("return_one_float_one_int_one_float") - self.return_and_test_struct_value("return_two_float") - # I am leaving out the packed test until we have a way to tell CLANG - # about alignment when reading DWARF for packed types. - #self.return_and_test_struct_value ("return_one_int_one_double_packed") - self.return_and_test_struct_value("return_one_int_one_long") + if not self.affected_by_radar_34562999(): + self.return_and_test_struct_value("return_one_int") + self.return_and_test_struct_value("return_two_int") + self.return_and_test_struct_value("return_three_int") + self.return_and_test_struct_value("return_four_int") + if not self.affected_by_pr33042(): + self.return_and_test_struct_value("return_five_int") + + self.return_and_test_struct_value("return_two_double") + self.return_and_test_struct_value("return_one_double_two_float") + self.return_and_test_struct_value("return_one_int_one_float_one_int") + + self.return_and_test_struct_value("return_one_pointer") + self.return_and_test_struct_value("return_two_pointer") + self.return_and_test_struct_value("return_one_float_one_pointer") + self.return_and_test_struct_value("return_one_int_one_pointer") + self.return_and_test_struct_value("return_three_short_one_float") + + self.return_and_test_struct_value("return_one_int_one_double") + self.return_and_test_struct_value("return_one_int_one_double_one_int") + self.return_and_test_struct_value( + "return_one_short_one_double_one_short") + self.return_and_test_struct_value("return_one_float_one_int_one_float") + self.return_and_test_struct_value("return_two_float") + # I am leaving out the packed test until we have a way to tell CLANG + # about alignment when reading DWARF for packed types. + #self.return_and_test_struct_value ("return_one_int_one_double_packed") + self.return_and_test_struct_value("return_one_int_one_long") @expectedFailureAll(oslist=["freebsd"], archs=["i386"]) @expectedFailureAll(oslist=["macosx"], archs=["i386"], bugnumber="<rdar://problem/28719652>") @@ -181,6 +186,7 @@ class ReturnValueTestCase(TestBase): archs=["i386"]) @expectedFailureAll(compiler=["gcc"], archs=["x86_64", "i386"]) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") + @skipIfDarwinEmbedded # <rdar://problem/33976032> ABIMacOSX_arm64 doesn't get structs this big correctly def test_vector_values(self): self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py b/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py index 16681fdbcdefb..97de99640f501 100644 --- a/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py +++ b/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py @@ -18,9 +18,6 @@ class HandleSegvTestCase(TestBase): @skipIfWindows # signals do not exist on Windows @skipIfDarwin - @expectedFailureAll( - oslist=['freebsd'], - bugnumber="llvm.org/pr23699 SIGSEGV is reported as exception, not signal") def test_inferior_handle_sigsegv(self): self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py index b0b2e609ba6bb..7ec934f26e0bb 100644 --- a/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py +++ b/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py @@ -52,6 +52,7 @@ class ReturnValueTestCase(TestBase): "3.9"], archs=["i386"], bugnumber="llvm.org/pr28549") + @expectedFailureAll(oslist=["ios", "tvos", "bridgeos"], bugnumber="<rdar://problem/34026777>") # lldb doesn't step past last source line in function on arm64 def test_step_in_with_python(self): """Test stepping in using avoid-no-debug with dwarf.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py b/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py index fa5c6de056507..74088581bad48 100644 --- a/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py +++ b/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py @@ -39,6 +39,7 @@ class StopHookMechanismTestCase(TestBase): @expectedFailureAll( hostoslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") + @skipIf(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k']) # <rdar://problem/34582291> problem with armv7 and step-over and stop-hook firing on ios etc systems def test(self): """Test the stop-hook mechanism.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py index c600d8ed21beb..275d54d2149c0 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py @@ -14,9 +14,9 @@ class ConcurrentBreakpointsDelayedBreakpointOneWatchpoint( mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test a breakpoint, a delayed breakpoint, and one watchpoint thread. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py index 169903816fa9c..c9cc6db960041 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py @@ -13,9 +13,9 @@ class ConcurrentCrashWithWatchpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """ Test a thread that crashes while another thread hits a watchpoint.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py index 4a58e7cf6d711..d99107b6e9b63 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py @@ -13,9 +13,9 @@ class ConcurrentCrashWithWatchpointBreakpointSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """ Test a thread that crashes while other threads generate a signal and hit a watchpoint and breakpoint. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py index d5d4641bc1649..28c5c68d45069 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py @@ -13,9 +13,9 @@ class ConcurrentDelaySignalWatch(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test a watchpoint and a (1 second delay) signal in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py index 9cbb40cb6019a..2d7c984e0e1ca 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py @@ -13,9 +13,9 @@ class ConcurrentDelayWatchBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test (1-second delay) watchpoint and a breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py index ccbeeb07d3a80..0564c86dfcbdd 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py @@ -13,9 +13,9 @@ class ConcurrentDelayedCrashWithBreakpointWatchpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """ Test a thread with a delayed crash while other threads hit a watchpoint and a breakpoint. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp index 540b5148aefa6..c888aa0b6eb6d 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/main.cpp @@ -29,7 +29,7 @@ typedef std::vector<pthread_t> thread_vector; pseudo_barrier_t g_barrier; int g_breakpoint = 0; int g_sigusr1_count = 0; -std::atomic_int g_watchme; +uint32_t g_watchme; struct action_args { int delay; @@ -74,7 +74,7 @@ watchpoint_func (void *input) { pseudo_barrier_wait(g_barrier); do_action_args(input); - g_watchme += 1; // watchpoint triggers here + g_watchme = 1; // watchpoint triggers here return 0; } diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py index 73c1704e7e54b..96b610f2b90bb 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py @@ -17,6 +17,7 @@ class ConcurrentManyWatchpoints(ConcurrentEventsBase): "Skip this long running test") # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test 100 watchpoints from 100 threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py index b9a7c5f568cbc..b921ac04ccc5d 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py @@ -13,9 +13,9 @@ class ConcurrentNWatchNBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test with 5 watchpoint and breakpoint threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py index 1282453438037..2f3b858854b8f 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py @@ -13,9 +13,9 @@ class ConcurrentSignalDelayWatch(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test a (1 second delay) watchpoint and a signal in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py index 56217e1e8c3ff..ebb13d99fb3c0 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py @@ -13,9 +13,9 @@ class ConcurrentSignalNWatchNBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test one signal thread with 5 watchpoint and breakpoint threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py index 0010628962652..0fbaf364045d6 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py @@ -13,9 +13,9 @@ class ConcurrentSignalWatch(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test a watchpoint and a signal in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py index d7725002f2bdb..53da6658550d2 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py @@ -13,9 +13,9 @@ class ConcurrentSignalWatchBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test a signal/watchpoint/breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py index f26a5dc6f8483..687be17ddc5aa 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py @@ -13,9 +13,9 @@ class ConcurrentTwoBreakpointsOneWatchpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a breakpoint and one watchpoint thread. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py index 059e077be98c7..025d91169451c 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py @@ -13,9 +13,9 @@ class ConcurrentTwoWatchpointThreads(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a watchpoint. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py index 4b3c35ea8e68a..5e95531ae09aa 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py @@ -13,9 +13,9 @@ class ConcurrentTwoWatchpointsOneBreakpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a watchpoint and one breakpoint thread. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py index ae6f64451abf2..aa57e816bb58a 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py @@ -13,9 +13,9 @@ class ConcurrentTwoWatchpointsOneDelayBreakpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a watchpoint and one (1 second delay) breakpoint thread. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py index 78f2dbbc83256..31b583c1a65a1 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py @@ -13,9 +13,10 @@ class ConcurrentTwoWatchpointsOneSignal(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @expectedFailureAll(bugnumber="llvm.org/pr35228", archs=["arm", "aarch64"]) + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a watchpoint and one signal thread. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py index ffa6909129adf..241ea5b64a03f 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py @@ -13,9 +13,9 @@ class ConcurrentWatchBreak(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test watchpoint and a breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py index 4c8b5b319ae47..79a54b620e537 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py @@ -13,9 +13,9 @@ class ConcurrentWatchBreakDelay(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test watchpoint and a (1 second delay) breakpoint in multiple threads.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py index 0d545b31230f2..6a37abdbcbb85 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py @@ -13,9 +13,9 @@ class ConcurrentWatchpointDelayWatchpointOneBreakpoint(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a watchpoint (one with a 1 second delay) and one breakpoint thread. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py index 56cd85da88d3e..67ac92b853cdc 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py @@ -13,9 +13,9 @@ class ConcurrentWatchpointWithDelayWatchpointThreads(ConcurrentEventsBase): mydir = ConcurrentEventsBase.compute_mydir(__file__) @skipIfFreeBSD # timing out on buildbot - @skipIfRemoteDueToDeadlock # Atomic sequences are not supported yet for MIPS in LLDB. @skipIf(triple='^mips') + @add_test_categories(["watchpoint"]) def test(self): """Test two threads that trigger a watchpoint where one thread has a 1 second delay. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py index fb6208a0d3e54..442887ed4e134 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py @@ -23,6 +23,7 @@ class CreateAfterAttachTestCase(TestBase): # Occasionally hangs on Windows, may be same as other issues. @skipIfWindows @skipIfiOSSimulator + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails def test_create_after_attach_with_popen(self): """Test thread creation after process attach.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) @@ -33,6 +34,7 @@ class CreateAfterAttachTestCase(TestBase): @skipIfRemote @skipIfWindows # Windows doesn't have fork. @skipIfiOSSimulator + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails def test_create_after_attach_with_fork(self): """Test thread creation after process attach.""" self.build(dictionary=self.getBuildFlags(use_cpp11=False)) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py index 5c0544f0ccabe..456c890673cc2 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py @@ -26,9 +26,6 @@ class ExitDuringBreakpointTestCase(TestBase): @expectedFailureAll( oslist=["linux"], bugnumber="llvm.org/pr15824 thread states not properly maintained") - @expectedFailureAll( - oslist=["freebsd"], - bugnumber="llvm.org/pr18190 thread states not properly maintained") def test(self): """Test thread exit during breakpoint handling.""" self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py index 85fa5d380cff2..75a9b8873ddaa 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py @@ -8,6 +8,7 @@ from __future__ import print_function import os import time import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil @@ -60,7 +61,8 @@ class NumberOfThreadsTestCase(TestBase): self.assertTrue( num_threads >= 13, 'Number of expected threads and actual threads do not match.') - + + @skipIfDarwin # rdar://33462362 def test_unique_stacks(self): """Test backtrace unique with multiple threads executing the same stack.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py b/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py index f043013b90cef..9c8bbf1eb081f 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py @@ -40,6 +40,7 @@ class ThreadStepOutTestCase(TestBase): oslist=["freebsd"], bugnumber="llvm.org/pr19347 2nd thread stops at breakpoint") @expectedFailureAll(oslist=["windows"]) + @expectedFailureAll(oslist=["watchos"], archs=['armv7k'], bugnumber="rdar://problem/34674488") # stop reason is trace when it should be step-out def test_step_all_threads(self): """Test thread step out on all threads via command interpreter. """ self.build(dictionary=self.getBuildFlags()) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/step_until/.categories b/packages/Python/lldbsuite/test/functionalities/thread/step_until/.categories new file mode 100644 index 0000000000000..c00c25822e4c2 --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/thread/step_until/.categories @@ -0,0 +1 @@ +basic_process diff --git a/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py b/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py index ec34c9985d3e9..d63d5c55bc825 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py @@ -15,9 +15,6 @@ class TestCStepping(TestBase): mydir = TestBase.compute_mydir(__file__) - def getCategories(self): - return ['basic_process'] - def setUp(self): # Call super's setUp(). TestBase.setUp(self) diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py index 0377b0c0a80e3..8f004e6d319be 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -20,6 +20,7 @@ class ThreadSpecificBreakTestCase(TestBase): @add_test_categories(['pyapi']) @expectedFailureAll(oslist=["windows"]) + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563920') # armv7 ios problem - breakpoint with tid qualifier isn't working def test_python(self): """Test that we obey thread conditioned breakpoints.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py index da9ba59f99248..3eddaca3e30de 100644 --- a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py +++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py @@ -24,6 +24,7 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase): # hits break in another thread in testrun @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522') @add_test_categories(['pyapi']) + @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563348') # Two threads seem to end up with the same my_value when built for armv7. def test_python(self): """Test that we obey thread conditioned breakpoints.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/type_completion/Makefile b/packages/Python/lldbsuite/test/functionalities/type_completion/Makefile index b69775dc199a4..8a7102e347af2 100644 --- a/packages/Python/lldbsuite/test/functionalities/type_completion/Makefile +++ b/packages/Python/lldbsuite/test/functionalities/type_completion/Makefile @@ -2,11 +2,4 @@ LEVEL = ../../make CXX_SOURCES := main.cpp -# clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD -# targets. Other targets do not, which causes this test to fail. -# This flag enables FullDebugInfo for all targets. -ifneq (,$(findstring clang,$(CC))) - CFLAGS_EXTRAS += -fno-limit-debug-info -endif - include $(LEVEL)/Makefile.rules diff --git a/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py b/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py index e35bb966c9182..598efbc5e0300 100644 --- a/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py +++ b/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py @@ -19,6 +19,7 @@ class SigtrampUnwind(TestBase): # On different platforms the "_sigtramp" and "__kill" frames are likely to be different. # This test could probably be adapted to run on linux/*bsd easily enough. @skipUnlessDarwin + @expectedFailureAll(oslist=["ios", "watchos", "tvos", "bridgeos"], bugnumber="<rdar://problem/34006863>") # lldb skips 1 frame on arm64 above _sigtramp def test(self): """Test that we can backtrace correctly with _sigtramp on the stack""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/.categories b/packages/Python/lldbsuite/test/functionalities/watchpoint/.categories new file mode 100644 index 0000000000000..50c1613cda72f --- /dev/null +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/.categories @@ -0,0 +1 @@ +watchpoint diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py index 6a68730e08eda..9fac249936eab 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py @@ -33,8 +33,6 @@ class HelloWatchLocationTestCase(TestBase): self.exe_name = self.testMethodName self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -43,12 +41,6 @@ class HelloWatchLocationTestCase(TestBase): @expectedFailureAll(triple=re.compile('^mips')) # SystemZ also currently supports only one H/W watchpoint @expectedFailureAll(archs=['s390x']) - @expectedFailureAll( - oslist=["linux"], - archs=[ - "arm", - "aarch64"], - bugnumber="llvm.org/pr27795") @skipIfDarwin def test_hello_watchlocation(self): """Test watching a location with '-s size' option.""" diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py index c74452fd375e9..2cfba398bac94 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py @@ -15,9 +15,6 @@ from lldbsuite.test import lldbutil class HelloWatchpointTestCase(TestBase): - def getCategories(self): - return ['basic_process'] - mydir = TestBase.compute_mydir(__file__) def setUp(self): @@ -34,11 +31,10 @@ class HelloWatchpointTestCase(TestBase): self.exe_name = 'a.out' self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + @add_test_categories(["basic_process"]) def test_hello_watchpoint_using_watchpoint_set(self): """Test a simple sequence of watchpoint creation and watchpoint hit.""" self.build(dictionary=self.d) diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py index 2e58cb893b73f..ac2c2fb8ec5a3 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py @@ -30,8 +30,6 @@ class WatchpointSlotsTestCase(TestBase): self.exe_name = 'a.out' self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) # This is a arm and aarch64 specific test case. No other architectures tested. @skipIf(archs=no_match(['arm', 'aarch64'])) def test_multiple_watchpoints_on_same_word(self): @@ -67,9 +65,12 @@ class WatchpointSlotsTestCase(TestBase): # The hit count should be 0 initially. self.expect("watchpoint list -v 1", substrs=['hit_count = 0']) - # Try setting a watchpoint at byteArray[1] - self.expect("watchpoint set variable byteArray[1]", error=True, - substrs=['Watchpoint creation failed']) + # debugserver on ios doesn't give an error, it creates another watchpoint, + # only expect errors on non-darwin platforms. + if not self.platformIsDarwin(): + # Try setting a watchpoint at byteArray[1] + self.expect("watchpoint set variable byteArray[1]", error=True, + substrs=['Watchpoint creation failed']) self.runCmd("process continue") @@ -90,8 +91,13 @@ class WatchpointSlotsTestCase(TestBase): # We should be stopped due to the watchpoint. # The stop reason of the thread should be watchpoint. - self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT, - substrs=['stopped', 'stop reason = watchpoint 3']) + if self.platformIsDarwin(): + # On darwin we'll hit byteArray[3] which is watchpoint 2 + self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT, + substrs=['stopped', 'stop reason = watchpoint 2']) + else: + self.expect("thread list -v", STOPPED_DUE_TO_WATCHPOINT, + substrs=['stopped', 'stop reason = watchpoint 3']) # Resume inferior. self.runCmd("process continue") diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py index 78273d6ec69c5..0c5798fdddfec 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py @@ -18,8 +18,6 @@ class WatchpointForMultipleThreadsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -29,8 +27,6 @@ class WatchpointForMultipleThreadsTestCase(TestBase): self.setTearDownCleanup() self.hello_multiple_threads() - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py index 15657708ce46b..71686a5f5c491 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py @@ -13,11 +13,6 @@ class TestStepOverWatchpoint(TestBase): mydir = TestBase.compute_mydir(__file__) - def getCategories(self): - return ['basic_process'] - - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=[ @@ -29,6 +24,8 @@ class TestStepOverWatchpoint(TestBase): bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") # Read-write watchpoints not supported on SystemZ @expectedFailureAll(archs=['s390x']) + @expectedFailureAll(oslist=["ios", "watchos", "tvos", "bridgeos"], bugnumber="<rdar://problem/34027183>") # watchpoint tests aren't working on arm64 + @add_test_categories(["basic_process"]) def test(self): """Test stepping over watchpoints.""" self.build() diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py index 7a9904c53f839..82865e646be52 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py @@ -36,8 +36,6 @@ class WatchpointCommandsTestCase(TestBase): self.exe_name = self.testMethodName self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -109,8 +107,6 @@ class WatchpointCommandsTestCase(TestBase): self.expect("watchpoint list -v", substrs=['hit_count = 2']) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -168,8 +164,6 @@ class WatchpointCommandsTestCase(TestBase): self.expect("process status", substrs=['exited']) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -230,8 +224,6 @@ class WatchpointCommandsTestCase(TestBase): self.expect("watchpoint list -v", substrs=['hit_count = 2', 'ignore_count = 2']) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -302,8 +294,6 @@ class WatchpointCommandsTestCase(TestBase): self.expect("watchpoint list -v", substrs=['hit_count = 1']) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py index 5b89f14dd8538..a4ceca34c0866 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py @@ -33,8 +33,6 @@ class WatchpointLLDBCommandTestCase(TestBase): self.exe_name = 'a%d.out' % self.test_number self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=["aarch64"], @@ -103,8 +101,6 @@ class WatchpointLLDBCommandTestCase(TestBase): self.expect("frame variable --show-globals cookie", substrs=['(int32_t)', 'cookie = 777']) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=["aarch64"], diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py index 16a34428ad708..50cd88bd86259 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py @@ -37,8 +37,6 @@ class WatchpointPythonCommandTestCase(TestBase): @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=["aarch64"], @@ -109,8 +107,6 @@ class WatchpointPythonCommandTestCase(TestBase): @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=["aarch64"], diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py index 5a16856149bab..34502a6d1d36e 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py @@ -33,8 +33,6 @@ class WatchpointConditionCmdTestCase(TestBase): self.exe_name = self.testMethodName self.d = {'CXX_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=["aarch64"], diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py index aac001e9db5a5..dad633f052c65 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py @@ -16,8 +16,6 @@ class TestWatchpointSetEnable(TestBase): # Call super's setUp(). TestBase.setUp(self) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -26,7 +24,6 @@ class TestWatchpointSetEnable(TestBase): self.build() self.do_test(False) - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py index 02180a127a8e9..ea25803825206 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py @@ -22,8 +22,6 @@ class TestWatchpointEvents (TestBase): self.main_source = "main.c" @add_test_categories(['pyapi']) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=["aarch64"], diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py index 3f301fd9f1a9b..ee4b05c12659e 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py @@ -17,8 +17,6 @@ class TestValueOfVectorVariableTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py index 1a94276c58e8f..b53e323cf4bdd 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py @@ -30,8 +30,6 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase): # Build dictionary to have unique executable names for each test # method. - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["linux"], archs=[ diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py index e342e34667fe9..ee64024893304 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py @@ -31,8 +31,6 @@ class WatchpointSizeTestCase(TestBase): self.exe_name = 'a.out' self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name} - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -42,8 +40,6 @@ class WatchpointSizeTestCase(TestBase): """Test to selectively watch different bytes in a 8-byte array.""" self.run_watchpoint_size_test('byteArray', 8, '1') - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") @@ -53,8 +49,6 @@ class WatchpointSizeTestCase(TestBase): """Test to selectively watch different words in an 8-byte word array.""" self.run_watchpoint_size_test('wordArray', 4, '2') - # Watchpoints not supported - @expectedFailureAndroid(archs=['arm', 'aarch64']) @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") |