sivachandra created this revision.
sivachandra added reviewers: dblaikie, clayborg.
sivachandra added a subscriber: lldb-commits.
http://reviews.llvm.org/D13143
Files:
test/lang/cpp/incomplete-types/Makefile
test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
test/lang/cpp/incomplete-types/a.cpp
test/lang/cpp/incomplete-types/a.h
test/lang/cpp/incomplete-types/length.cpp
test/lang/cpp/incomplete-types/length.h
test/lang/cpp/incomplete-types/main.cpp
Index: test/lang/cpp/incomplete-types/main.cpp
===================================================================
--- test/lang/cpp/incomplete-types/main.cpp
+++ test/lang/cpp/incomplete-types/main.cpp
@@ -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
}
Index: test/lang/cpp/incomplete-types/length.h
===================================================================
--- test/lang/cpp/incomplete-types/length.h
+++ test/lang/cpp/incomplete-types/length.h
@@ -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
Index: test/lang/cpp/incomplete-types/length.cpp
===================================================================
--- test/lang/cpp/incomplete-types/length.cpp
+++ test/lang/cpp/incomplete-types/length.cpp
@@ -1,8 +1,8 @@
#include "length.h"
-size_t
-length (const std::string &str)
+int
+length (A &a)
{
- return str.length();
+ return a.length();
}
Index: test/lang/cpp/incomplete-types/a.h
===================================================================
--- /dev/null
+++ test/lang/cpp/incomplete-types/a.h
@@ -0,0 +1,11 @@
+#ifndef __A_H__
+#define __A_H__
+
+class A
+{
+public:
+ A();
+ virtual int length();
+};
+
+#endif
Index: test/lang/cpp/incomplete-types/a.cpp
===================================================================
--- /dev/null
+++ test/lang/cpp/incomplete-types/a.cpp
@@ -0,0 +1,10 @@
+
+#include "a.h"
+
+A::A () { }
+
+int
+A::length ()
+{
+ return 123;
+}
Index: test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
===================================================================
--- test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
+++ test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
@@ -16,9 +16,9 @@
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 @@
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)
Index: test/lang/cpp/incomplete-types/Makefile
===================================================================
--- test/lang/cpp/incomplete-types/Makefile
+++ test/lang/cpp/incomplete-types/Makefile
@@ -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 @@
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_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
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits