summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-10-27 18:44:45 +0000
committerEnrico Granata <egranata@apple.com>2016-10-27 18:44:45 +0000
commitc046497bf087f00e520b112c07cbaa6a44d7ea31 (patch)
treef604f1cc2ad9efd52751a3f18c431d670a4894b7 /lldb/packages/Python
parentc8efda7f80946f7a11471ecf22a4528f875b56e8 (diff)
downloadbcm5719-llvm-c046497bf087f00e520b112c07cbaa6a44d7ea31.tar.gz
bcm5719-llvm-c046497bf087f00e520b112c07cbaa6a44d7ea31.zip
Add support for "type lookup" to find C and C++ types
This is an important first step in closing the functionality gap between "type lookup" and "images lookup -t" rdar://28971388 llvm-svn: 285332
Diffstat (limited to 'lldb/packages/Python')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile2
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py6
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm (renamed from lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m)22
3 files changed, 26 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile
index 31e57fe28a5..7fb4d7a5ab1 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../make
-OBJC_SOURCES := main.m
+OBJCXX_SOURCES := main.mm
CFLAGS_EXTRAS += -w
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
index dc4f125e372..62f7766604c 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
@@ -22,7 +22,7 @@ class TypeLookupTestCase(TestBase):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break at.
- self.line = line_number('main.m', '// break here')
+ self.line = line_number('main.mm', '// break here')
@skipUnlessDarwin
@skipIf(archs=['i386'])
@@ -32,7 +32,7 @@ class TypeLookupTestCase(TestBase):
self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
- self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
+ self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
@@ -50,3 +50,5 @@ class TypeLookupTestCase(TestBase):
self.expect('type lookup NSObject', substrs=['NSObject', 'isa'])
self.expect('type lookup PleaseDontBeARealTypeThatExists', substrs=[
"no type was found matching 'PleaseDontBeARealTypeThatExists'"])
+ self.expect('type lookup MyCPPClass', substrs=['setF', 'float getF'])
+ self.expect('type lookup MyClass', substrs=['setF', 'float getF'])
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm
index 058a0c00e92..d522e0b16d7 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.m
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/type_lookup/main.mm
@@ -1,4 +1,4 @@
-//===-- main.m ------------------------------------------------*- ObjC -*-===//
+//===-- main.mm -----------------------------------------------*- ObjC -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -9,8 +9,28 @@
#import <Foundation/Foundation.h>
+class MyCPPClass {
+public:
+ MyCPPClass(float f) : f(f) {}
+
+ float setF(float f) {
+ float oldf = this->f;
+ this->f = f;
+ return oldf;
+ }
+
+ float getF() {
+ return f;
+ }
+private:
+ float f;
+};
+
+typedef MyCPPClass MyClass;
+
int main (int argc, const char * argv[])
{
+ MyClass my_cpp(3.1415);
return 0; // break here
}
OpenPOWER on IntegriCloud