Don't muck with _LIBCPP_INLINE_VISIBILITY just to get predictable line table entries.
authorJim Ingham <jingham@apple.com>
Thu, 5 Jul 2018 23:11:27 +0000 (23:11 +0000)
committerJim Ingham <jingham@apple.com>
Thu, 5 Jul 2018 23:11:27 +0000 (23:11 +0000)
This test was trying to stop at a variety of std::vector calls.  It looks like the test
was failing because various inlined std functions left no line table entries for the line that
invoked the inlined function.  The author worked around that by undefining _LIBCPP_INLINE_VISIBILITY.

That's an internal libcxx macro, we really shouldn't be playing around with it.  Better to just force
ourselves to stop where we want using some other non-inlineable statement.  printf seems a good candidate...

<rdar://problem/41867390>

llvm-svn: 336397

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp

index a9aeacf..32dc104 100644 (file)
@@ -1,8 +1,5 @@
+#include <stdio.h>
 #include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
 #include <vector>
 typedef std::vector<int> int_vect;
 typedef std::vector<std::string> string_vect;
@@ -18,7 +15,8 @@ int main()
     (numbers.push_back(123456));
     (numbers.push_back(1234567));
     
-    numbers.clear(); // break here
+    printf("break here");
+    numbers.clear();
     
     (numbers.push_back(7)); // break here
 
@@ -26,10 +24,11 @@ int main()
     (strings.push_back(std::string("goofy")));
     (strings.push_back(std::string("is")));
     (strings.push_back(std::string("smart")));
-    
-    (strings.push_back(std::string("!!!"))); // break here
-    
-    strings.clear();  // break here
+    printf("break here");
+    (strings.push_back(std::string("!!!")));
+     
+    printf("break here");
+    strings.clear();
     
     return 0;  // break here
 }