diff options
author | Ted Woodward <ted.woodward@codeaurora.org> | 2017-09-07 16:24:39 +0000 |
---|---|---|
committer | Ted Woodward <ted.woodward@codeaurora.org> | 2017-09-07 16:24:39 +0000 |
commit | 9927431d8156bd6ee956c6fb7e54b8e32dd4c772 (patch) | |
tree | c3ea38dcd3ed3f4a546b9e2e84267584661a4866 /lldb/packages/Python/lldbsuite/test | |
parent | c8c9d4a0a6c82c3f9dc4f4461b283aa238700aff (diff) | |
download | bcm5719-llvm-9927431d8156bd6ee956c6fb7e54b8e32dd4c772.tar.gz bcm5719-llvm-9927431d8156bd6ee956c6fb7e54b8e32dd4c772.zip |
Fix lldb-mi test data_read_memory_bytes_global
Summary:
Test was skipped because -data-evaluate-expression was thought
to not work on globals. This is not the case - the issue was clang
removes debug info for globals in cpp files that are not used.
Add a reference to the globals in question, and fix memory patter in
test to match memory pattern in testcase.
Reviewers: ki.stfu, abidh
Reviewed By: ki.stfu
Subscribers: aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D37533
llvm-svn: 312726
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py | 6 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py index 0b521812384..7dcebb172d3 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py @@ -88,8 +88,6 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races - # FIXME: the global case worked before refactoring - @unittest2.skip("-data-evaluate-expression doesn't work on globals") def test_lldbmi_data_read_memory_bytes_global(self): """Test that -data-read-memory-bytes can access global buffers.""" @@ -115,7 +113,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -data-read-memory-bytes works for char[] type (global) self.runCmd("-data-read-memory-bytes %#x %d" % (addr, size)) self.expect( - "\^done,memory=\[{begin=\"0x0*%x\",offset=\"0x0+\",end=\"0x0*%x\",contents=\"1112131400\"}\]" % + "\^done,memory=\[{begin=\"0x0*%x\",offset=\"0x0+\",end=\"0x0*%x\",contents=\"1011121300\"}\]" % (addr, addr + size)) # Get address of static char[] @@ -127,7 +125,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -data-read-memory-bytes works for static char[] type self.runCmd("-data-read-memory-bytes %#x %d" % (addr, size)) self.expect( - "\^done,memory=\[{begin=\"0x0*%x\",offset=\"0x0+\",end=\"0x0*%x\",contents=\"1112131400\"}\]" % + "\^done,memory=\[{begin=\"0x0*%x\",offset=\"0x0+\",end=\"0x0*%x\",contents=\"2021222300\"}\]" % (addr, addr + size)) @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp index 8030fe891de..85c38634f84 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp @@ -17,6 +17,8 @@ local_array_test_inner() { char array[] = { 0x01, 0x02, 0x03, 0x04 }; char *first_element_ptr = &array[0]; + char g = g_CharArray[0]; + char s = s_CharArray[0]; // BP_local_array_test_inner return; } |