diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py | 142 |
1 files changed, 84 insertions, 58 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py index a62b9a25400..0406ede7178 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py @@ -5,23 +5,25 @@ Test lldb-mi -exec-xxx commands. from __future__ import print_function - import lldbmi_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil + class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): mydir = TestBase.compute_mydir(__file__) - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races - @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr25000: lldb-mi does not receive broadcasted notification from Core/Process about process stopped") + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @expectedFailureAll( + oslist=["linux"], + bugnumber="llvm.org/pr25000: lldb-mi does not receive broadcasted notification from Core/Process about process stopped") def test_lldbmi_exec_run(self): """Test that 'lldb-mi --interpreter' can stop at entry.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -30,20 +32,22 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test that program is stopped at entry self.runCmd("-exec-run --start") self.expect("\^running") - self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*?thread-id=\"1\",stopped-threads=\"all\"") + self.expect( + "\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*?thread-id=\"1\",stopped-threads=\"all\"") # Test that lldb-mi is ready to execute next commands - self.expect(self.child_prompt, exactly = True) + self.expect(self.child_prompt, exactly=True) - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_abort(self): """Test that 'lldb-mi --interpreter' works for -exec-abort.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Test that -exec-abort fails on invalid process self.runCmd("-exec-abort") - self.expect("\^error,msg=\"Command 'exec-abort'\. Invalid process during debug session\"") + self.expect( + "\^error,msg=\"Command 'exec-abort'\. Invalid process during debug session\"") # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -83,19 +87,20 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^done") self.expect("\*stopped,reason=\"exited-normally\"") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_arguments_set(self): """Test that 'lldb-mi --interpreter' can pass args using -exec-arguments.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) self.expect("\^done") # Set arguments - self.runCmd("-exec-arguments --arg1 \"2nd arg\" third_arg fourth=\"4th arg\"") + self.runCmd( + "-exec-arguments --arg1 \"2nd arg\" third_arg fourth=\"4th arg\"") self.expect("\^done") # Run to main @@ -109,7 +114,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-data-evaluate-expression argc") self.expect("\^done,value=\"5\"") #self.runCmd("-data-evaluate-expression argv[1]") - #self.expect("\^done,value=\"--arg1\"") + # self.expect("\^done,value=\"--arg1\"") self.runCmd("-interpreter-exec command \"print argv[1]\"") self.expect("\"--arg1\"") #self.runCmd("-data-evaluate-expression argv[2]") @@ -117,7 +122,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-interpreter-exec command \"print argv[2]\"") self.expect("\"2nd arg\"") #self.runCmd("-data-evaluate-expression argv[3]") - #self.expect("\^done,value=\"third_arg\"") + # self.expect("\^done,value=\"third_arg\"") self.runCmd("-interpreter-exec command \"print argv[3]\"") self.expect("\"third_arg\"") #self.runCmd("-data-evaluate-expression argv[4]") @@ -125,12 +130,12 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-interpreter-exec command \"print argv[4]\"") self.expect("\"fourth=\\\\\\\"4th arg\\\\\\\"\"") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_arguments_reset(self): """Test that 'lldb-mi --interpreter' can reset previously set args using -exec-arguments.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -153,12 +158,12 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-data-evaluate-expression argc") self.expect("\^done,value=\"1\"") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_next(self): """Test that 'lldb-mi --interpreter' works for stepping.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -176,22 +181,26 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test -exec-next self.runCmd("-exec-next --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") # Test that --thread is optional self.runCmd("-exec-next --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"") # Test that --frame is optional self.runCmd("-exec-next --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"31\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"31\"") # Test that both --thread and --frame are optional self.runCmd("-exec-next") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"32\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"32\"") # Test that an invalid --thread is handled self.runCmd("-exec-next --thread 0") @@ -204,13 +213,15 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-exec-next --frame 10") #self.expect("\^error: Frame index 10 is out of range") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races - @expectedFailureAll(archs=["i[3-6]86"], bugnumber="xfail to get buildbot green, failing config: i386 binary running on ubuntu 14.04 x86_64") + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @expectedFailureAll( + archs=["i[3-6]86"], + bugnumber="xfail to get buildbot green, failing config: i386 binary running on ubuntu 14.04 x86_64") def test_lldbmi_exec_next_instruction(self): """Test that 'lldb-mi --interpreter' works for instruction stepping.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -229,25 +240,29 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test -exec-next-instruction self.runCmd("-exec-next-instruction --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"28\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"28\"") # Test that --thread is optional self.runCmd("-exec-next-instruction --frame 0") self.expect("\^running") # Depending on compiler, it can stop at different line - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(28|29)\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(28|29)\"") # Test that --frame is optional self.runCmd("-exec-next-instruction --thread 1") self.expect("\^running") # Depending on compiler, it can stop at different line - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(29|30)\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(29|30)\"") # Test that both --thread and --frame are optional self.runCmd("-exec-next-instruction") self.expect("\^running") # Depending on compiler, it can stop at different line - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(29|30|31)\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(29|30|31)\"") # Test that an invalid --thread is handled self.runCmd("-exec-next-instruction --thread 0") @@ -260,12 +275,12 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-exec-next-instruction --frame 10") #self.expect("\^error: Frame index 10 is out of range") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_step(self): """Test that 'lldb-mi --interpreter' works for stepping into.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -283,39 +298,45 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -exec-step steps into (or not) printf depending on debug info # Note that message is different in Darwin and Linux: # Darwin: "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value="0x[0-9a-f]+\"}],file=\"main.cpp\",fullname=\".+main.cpp\",line=\"\d\"},thread-id=\"1\",stopped-threads=\"all\" - # Linux: "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\" + # Linux: + # "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\" self.runCmd("-exec-step --thread 1 --frame 0") self.expect("\^running") - it = self.expect([ "\*stopped,reason=\"end-stepping-range\".+?func=\"main\"", - "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\"" ]) + it = self.expect(["\*stopped,reason=\"end-stepping-range\".+?func=\"main\"", + "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\""]) # Exit from printf if needed if it == 1: self.runCmd("-exec-finish") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") # Test that -exec-step steps into g_MyFunction and back out # (and that --thread is optional) self.runCmd("-exec-step --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Use -exec-finish here to make sure that control reaches the caller. # -exec-step can keep us in the g_MyFunction for gcc self.runCmd("-exec-finish --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"") # Test that -exec-step steps into s_MyFunction # (and that --frame is optional) self.runCmd("-exec-step --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"") # Test that -exec-step steps into g_MyFunction from inside # s_MyFunction (and that both --thread and --frame are optional) self.runCmd("-exec-step") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that an invalid --thread is handled self.runCmd("-exec-step --thread 0") @@ -328,12 +349,12 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-exec-step --frame 10") #self.expect("\^error: Frame index 10 is out of range") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_step_instruction(self): """Test that 'lldb-mi --interpreter' works for instruction stepping into.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -352,7 +373,8 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -exec-next steps over printf self.runCmd("-exec-next --thread 1 --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"") # Test that -exec-step-instruction steps over non branching # instruction @@ -364,19 +386,22 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # instruction (and that --thread is optional) self.runCmd("-exec-step-instruction --frame 0") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that -exec-step-instruction steps over non branching # (and that --frame is optional) self.runCmd("-exec-step-instruction --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that -exec-step-instruction steps into g_MyFunction # (and that both --thread and --frame are optional) self.runCmd("-exec-step-instruction") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"") # Test that an invalid --thread is handled self.runCmd("-exec-step-instruction --thread 0") @@ -389,12 +414,12 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.runCmd("-exec-step-instruction --frame 10") #self.expect("\^error: Frame index 10 is out of range") - @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows - @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_exec_finish(self): """Test that 'lldb-mi --interpreter' works for -exec-finish.""" - self.spawnLldbMi(args = None) + self.spawnLldbMi(args=None) # Load executable self.runCmd("-file-exec-and-symbols %s" % self.myexe) @@ -429,7 +454,8 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): # s_MyFunction (and that --frame is optional) self.runCmd("-exec-finish --thread 1") self.expect("\^running") - self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"") + self.expect( + "\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"") # Test that -exec-finish returns from s_MyFunction # (and that both --thread and --frame are optional) @@ -455,7 +481,7 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^running") self.expect("\*stopped,reason=\"breakpoint-hit\"") - ## Test that -exec-finish returns from printf + # Test that -exec-finish returns from printf self.runCmd("-exec-finish --thread 1 --frame 0") self.expect("\^running") self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"") |