diff options
author | Enrico Granata <egranata@apple.com> | 2015-11-07 02:06:57 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-11-07 02:06:57 +0000 |
commit | 7123e2b5d79b6ed18f56ebac1e8c8bc1a57ea23c (patch) | |
tree | 7cbfbd7a15cc2fdc98a4a3e736b0a7372253a154 /lldb/packages/Python/lldbsuite/test/python_api | |
parent | ea1df7fe9fc363e7583f691431b54fdb658fe0a8 (diff) | |
download | bcm5719-llvm-7123e2b5d79b6ed18f56ebac1e8c8bc1a57ea23c.tar.gz bcm5719-llvm-7123e2b5d79b6ed18f56ebac1e8c8bc1a57ea23c.zip |
Add SBType::IsAnonymousType() and relative plumbing in the debugger internals
For language that support such a thing, this API allows to ask whether a type is anonymous (i.e. has been given no name)
Comes with test case
llvm-svn: 252390
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py | 5 | ||||
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py b/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py index 58bf5e5b988..d9e5719844e 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py @@ -59,11 +59,16 @@ class TypeAndTypeListTestCase(TestBase): for type in type_list: self.assertTrue(type) self.DebugSBType(type) + self.assertFalse(type.IsAnonymousType(), "Task is not anonymous") for field in type.fields: if field.name == "type": for enum_member in field.type.enum_members: self.assertTrue(enum_member) self.DebugSBType(enum_member.type) + elif field.name == "my_type_is_nameless": + self.assertTrue(field.type.IsAnonymousType(), "my_type_is_nameless has an anonymous type") + elif field.name == "my_type_is_named": + self.assertFalse(field.type.IsAnonymousType(), "my_type_is_named has a named type") # Pass an empty string. LLDB should not crash. :-) fuzz_types = target.FindTypes(None) diff --git a/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp b/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp index 67b57ace08f..b7f3dcc7fbe 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/python_api/type/main.cpp @@ -16,6 +16,12 @@ public: TASK_TYPE_1, TASK_TYPE_2 } type; + struct { + int x; + } my_type_is_nameless; + struct name { + int x; + } my_type_is_named; Task(int i, Task *n): id(i), next(n), |