diff options
| author | Jaroslav Sevcik <jarin@google.com> | 2020-01-10 11:44:14 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2020-01-10 11:45:24 +0100 |
| commit | 902974277d507a149e33487d32e4ba58c41451b6 (patch) | |
| tree | 6c0a515cb60bdd1e63ce038b2a36bcd35d84777d /lldb/source/Symbol | |
| parent | f3849f739e52510871d11361125f0ef239f11603 (diff) | |
| download | bcm5719-llvm-902974277d507a149e33487d32e4ba58c41451b6.tar.gz bcm5719-llvm-902974277d507a149e33487d32e4ba58c41451b6.zip | |
Data formatters: Look through array element typedefs
Summary:
Motivation: When formatting an array of typedefed chars, we would like to display the array as a string.
The string formatter currently does not trigger because the formatter lookup does not resolve typedefs for array elements (this behavior is inconsistent with pointers, for those we do look through pointee typedefs). This patch tries to make the array formatter lookup somewhat consistent with the pointer formatter lookup.
Reviewers: teemperor, clayborg
Reviewed By: teemperor, clayborg
Subscribers: clayborg, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72133
Diffstat (limited to 'lldb/source/Symbol')
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index c846e410acf..0cc83254947 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -3924,7 +3924,7 @@ CompilerType ClangASTContext::GetArrayElementType(lldb::opaque_compiler_type_t type, uint64_t *stride) { if (type) { - clang::QualType qual_type(GetCanonicalQualType(type)); + clang::QualType qual_type(GetQualType(type)); const clang::Type *array_eletype = qual_type.getTypePtr()->getArrayElementTypeNoTypeQual(); @@ -3932,8 +3932,7 @@ ClangASTContext::GetArrayElementType(lldb::opaque_compiler_type_t type, if (!array_eletype) return CompilerType(); - CompilerType element_type = - GetType(array_eletype->getCanonicalTypeUnqualified()); + CompilerType element_type = GetType(clang::QualType(array_eletype, 0)); // TODO: the real stride will be >= this value.. find the real one! if (stride) |

