diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py')
-rw-r--r-- | packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py | 65 |
1 files changed, 8 insertions, 57 deletions
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py b/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py index f3a277246862..5e6b3f20dde7 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py @@ -18,6 +18,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfRemote # We do not currently support remote debugging via the MI. @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_data_disassemble(self): """Test that 'lldb-mi --interpreter' works for -data-disassemble.""" @@ -79,8 +80,8 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): # To match the escaped characters in the ouptut, we must use four backslashes per matches backslash # See https://docs.python.org/2/howto/regex.html#the-backslash-plague - # The MIPS disassembler never prints stub name - if self.isMIPS(): + # The MIPS and PPC64le disassemblers never print stub name + if self.isMIPS() or self.isPPC64le(): self.expect(["{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; \\\\\"Hello, World!\\\\\\\\n\\\\\"\"}", "{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?\"}"]) else: @@ -89,6 +90,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfRemote # We do not currently support remote debugging via the MI. @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_data_read_memory_bytes_global(self): """Test that -data-read-memory-bytes can access global buffers.""" @@ -132,6 +134,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfRemote # We do not currently support remote debugging via the MI. @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_data_read_memory_bytes_local(self): """Test that -data-read-memory-bytes can access local buffers.""" @@ -272,6 +275,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfRemote # We do not currently support remote debugging via the MI. @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_data_list_register_names(self): """Test that 'lldb-mi --interpreter' works for -data-list-register-names.""" @@ -299,6 +303,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfRemote # We do not currently support remote debugging via the MI. @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_data_list_register_values(self): """Test that 'lldb-mi --interpreter' works for -data-list-register-values.""" @@ -328,61 +333,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfRemote # We do not currently support remote debugging via the MI. @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_data_info_line(self): - """Test that 'lldb-mi --interpreter' works for -data-info-line.""" - - self.spawnLldbMi(args=None) - - # Load executable - self.runCmd("-file-exec-and-symbols %s" % self.myexe) - self.expect("\^done") - - # Run to main - self.runCmd("-break-insert -f main") - self.expect("\^done,bkpt={number=\"1\"") - self.runCmd("-exec-run") - self.expect("\^running") - self.expect("\*stopped,reason=\"breakpoint-hit\"") - - # Get the address of main and its line - self.runCmd("-data-evaluate-expression main") - self.expect( - "\^done,value=\"0x[0-9a-f]+ \(a.out`main at main.cpp:[0-9]+\)\"") - addr = int(self.child.after.split("\"")[1].split(" ")[0], 16) - line = line_number('main.cpp', '// FUNC_main') - - # Test that -data-info-line works for address - self.runCmd("-data-info-line *%#x" % addr) - self.expect( - "\^done,start=\"0x0*%x\",end=\"0x[0-9a-f]+\",file=\".+?main.cpp\",line=\"%d\"" % - (addr, line)) - - # Test that -data-info-line works for file:line - self.runCmd("-data-info-line main.cpp:%d" % line) - self.expect( - "\^done,start=\"0x0*%x\",end=\"0x[0-9a-f]+\",file=\".+?main.cpp\",line=\"%d\"" % - (addr, line)) - - # Test that -data-info-line fails when invalid address is specified - self.runCmd("-data-info-line *0x0") - self.expect( - "\^error,msg=\"Command 'data-info-line'\. Error: The LineEntry is absent or has an unknown format\.\"") - - # Test that -data-info-line fails when file is unknown - self.runCmd("-data-info-line unknown_file:1") - self.expect( - "\^error,msg=\"Command 'data-info-line'\. Error: The LineEntry is absent or has an unknown format\.\"") - - # Test that -data-info-line fails when line has invalid format - self.runCmd("-data-info-line main.cpp:bad_line") - self.expect( - "\^error,msg=\"error: invalid line number string 'bad_line'") - self.runCmd("-data-info-line main.cpp:0") - self.expect("\^error,msg=\"error: zero is an invalid line number") - - @skipIfRemote # We do not currently support remote debugging via the MI. - @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows + @skipIfDarwin # pexpect is known to be unreliable on Darwin @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races def test_lldbmi_data_evaluate_expression(self): """Test that 'lldb-mi --interpreter' works for -data-evaluate-expression.""" |