[Lldb-commits] [PATCH] D37533: Fix lldb-mi test data_read_memory_bytes_global

Ted Woodward via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 6 14:41:09 PDT 2017


ted created this revision.
Herald added a subscriber: aprantl.

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.


https://reviews.llvm.org/D37533

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


Index: packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp
===================================================================
--- packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp
+++ packages/Python/lldbsuite/test/tools/lldb-mi/data/main.cpp
@@ -17,6 +17,8 @@
 {
     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;
 }
Index: packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
===================================================================
--- packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
+++ packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
@@ -88,8 +88,6 @@
 
     @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 @@
         # 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 @@
         # 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37533.114067.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170906/7b710161/attachment.bin>


More information about the lldb-commits mailing list