[Lldb-commits] [lldb] r248541 - [TestCppIncompleteTypes] Remove the dependence on std::string.

Siva Chandra via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 24 14:29:55 PDT 2015


Author: sivachandra
Date: Thu Sep 24 16:29:54 2015
New Revision: 248541

URL: http://llvm.org/viewvc/llvm-project?rev=248541&view=rev
Log:
[TestCppIncompleteTypes] Remove the dependence on std::string.

Reviewers: dblaikie, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13143

Added:
    lldb/trunk/test/lang/cpp/incomplete-types/a.cpp
    lldb/trunk/test/lang/cpp/incomplete-types/a.h
Modified:
    lldb/trunk/test/lang/cpp/incomplete-types/Makefile
    lldb/trunk/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
    lldb/trunk/test/lang/cpp/incomplete-types/length.cpp
    lldb/trunk/test/lang/cpp/incomplete-types/length.h
    lldb/trunk/test/lang/cpp/incomplete-types/main.cpp

Modified: lldb/trunk/test/lang/cpp/incomplete-types/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/Makefile?rev=248541&r1=248540&r2=248541&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/Makefile (original)
+++ lldb/trunk/test/lang/cpp/incomplete-types/Makefile Thu Sep 24 16:29:54 2015
@@ -1,6 +1,6 @@
 LEVEL = ../../../make
 
-CXX_SOURCES = main.cpp length.cpp
+CXX_SOURCES = main.cpp length.cpp a.cpp
 
 CFLAGS_LIMIT = -c $(CXXFLAGS)
 CFLAGS_NO_LIMIT = -c $(CXXFLAGS)
@@ -12,11 +12,11 @@ endif
 
 all: limit nolimit
 
-limit: main.o length_limit.o
-	$(CXX) $(LDFLAGS) main.o length_limit.o -o limit
+limit: main.o length_limit.o a.o
+	$(CXX) $(LDFLAGS) main.o length_limit.o a.o -o limit
 
-nolimit: main.o length_nolimit.o
-	$(CXX) $(LDFLAGS) main.o length_nolimit.o -o nolimit
+nolimit: main.o length_nolimit.o a.o
+	$(CXX) $(LDFLAGS) main.o length_nolimit.o a.o -o nolimit
 
 main.o: main.cpp
 	$(CXX) $(CFLAGS_LIMIT) main.cpp -o main.o
@@ -27,6 +27,9 @@ length_limit.o: length.cpp
 length_nolimit.o: length.cpp
 	$(CXX) $(CFLAGS_NO_LIMIT) length.cpp -o length_nolimit.o
 
+a.o: a.cpp
+	$(CXX) -c a.cpp -o a.o
+
 clean: OBJECTS += limit nolimit length_limit.o length_nolimit.o
 
 include $(LEVEL)/Makefile.rules

Modified: lldb/trunk/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py?rev=248541&r1=248540&r2=248541&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py (original)
+++ lldb/trunk/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py Thu Sep 24 16:29:54 2015
@@ -16,9 +16,9 @@ class TestCppIncompleteTypes(TestBase):
         self.assertTrue(value_f.IsValid(), "'expr f' results in a valid SBValue object")
         self.assertFalse(value_f.GetError().Success(), "'expr f' results in an error, but LLDB does not crash")
 
-        value_s = frame.EvaluateExpression("s")
-        self.assertTrue(value_s.IsValid(), "'expr s' results in a valid SBValue object")
-        self.assertFalse(value_s.GetError().Success(), "'expr s' results in an error, but LLDB does not crash")
+        value_a = frame.EvaluateExpression("a")
+        self.assertTrue(value_a.IsValid(), "'expr a' results in a valid SBValue object")
+        self.assertFalse(value_a.GetError().Success(), "'expr a' results in an error, but LLDB does not crash")
 
     @dwarf_test
     @skipIfGcc
@@ -30,9 +30,9 @@ class TestCppIncompleteTypes(TestBase):
         self.assertTrue(value_f.IsValid(), "'expr f' results in a valid SBValue object")
         self.assertTrue(value_f.GetError().Success(), "'expr f' is successful")
 
-        value_s = frame.EvaluateExpression("s")
-        self.assertTrue(value_s.IsValid(), "'expr s' results in a valid SBValue object")
-        self.assertTrue(value_s.GetError().Success(), "'expr s' is successful")
+        value_a = frame.EvaluateExpression("a")
+        self.assertTrue(value_a.IsValid(), "'expr a' results in a valid SBValue object")
+        self.assertTrue(value_a.GetError().Success(), "'expr a' is successful")
 
     def setUp(self):
         TestBase.setUp(self)

Added: lldb/trunk/test/lang/cpp/incomplete-types/a.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/a.cpp?rev=248541&view=auto
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/a.cpp (added)
+++ lldb/trunk/test/lang/cpp/incomplete-types/a.cpp Thu Sep 24 16:29:54 2015
@@ -0,0 +1,10 @@
+
+#include "a.h"
+
+A::A () { }
+
+int
+A::length ()
+{
+  return 123;
+}

Added: lldb/trunk/test/lang/cpp/incomplete-types/a.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/a.h?rev=248541&view=auto
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/a.h (added)
+++ lldb/trunk/test/lang/cpp/incomplete-types/a.h Thu Sep 24 16:29:54 2015
@@ -0,0 +1,11 @@
+#ifndef __A_H__
+#define __A_H__
+
+class A
+{
+public:
+  A();
+  virtual int length();
+};
+
+#endif

Modified: lldb/trunk/test/lang/cpp/incomplete-types/length.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/length.cpp?rev=248541&r1=248540&r2=248541&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/length.cpp (original)
+++ lldb/trunk/test/lang/cpp/incomplete-types/length.cpp Thu Sep 24 16:29:54 2015
@@ -1,8 +1,8 @@
 
 #include "length.h"
 
-size_t
-length (const std::string &str)
+int
+length (A &a)
 {
-  return str.length();
+  return a.length();
 }

Modified: lldb/trunk/test/lang/cpp/incomplete-types/length.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/length.h?rev=248541&r1=248540&r2=248541&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/length.h (original)
+++ lldb/trunk/test/lang/cpp/incomplete-types/length.h Thu Sep 24 16:29:54 2015
@@ -1,8 +1,8 @@
 #ifndef __LENGTH_H__
 #define __LENGTH_H__
 
-#include <string>
+#include "a.h"
 
-size_t length (const std::string &str);
+int length (A &a);
 
 #endif

Modified: lldb/trunk/test/lang/cpp/incomplete-types/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/incomplete-types/main.cpp?rev=248541&r1=248540&r2=248541&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/incomplete-types/main.cpp (original)
+++ lldb/trunk/test/lang/cpp/incomplete-types/main.cpp Thu Sep 24 16:29:54 2015
@@ -3,21 +3,16 @@
 
 class Foo {
 public:
-    Foo(std::string x) : s(x) {}
-
-private:
-    std::string s;
+    A a;
 };
 
-class MyString : public std::string {
-public:
-    MyString(std::string x) : std::string(x) {}
+class MyA : public A {
 };
 
 int main()
 {
-    Foo f("qwerty");
-    MyString s("qwerty");
+    Foo f;
+    MyA a;
 
-    return length(s); // break here
+    return length(a); // break here
 }




More information about the lldb-commits mailing list