[Lldb-commits] [lldb] r312726 - Fix lldb-mi test data_read_memory_bytes_global

Ted Woodward via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 7 09:24:39 PDT 2017


Author: ted
Date: Thu Sep  7 09:24:39 2017
New Revision: 312726

URL: http://llvm.org/viewvc/llvm-project?rev=312726&view=rev
Log:
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

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py?rev=312726&r1=312725&r2=312726&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py Thu Sep  7 09:24:39 2017
@@ -88,8 +88,6 @@ class MiDataTestCase(lldbmi_testcase.MiT
 
     @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.MiT
         # 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.MiT
         # 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

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp?rev=312726&r1=312725&r2=312726&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp Thu Sep  7 09:24:39 2017
@@ -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;
 }




More information about the lldb-commits mailing list