[Lldb-commits] [lldb] 2a4a498 - [LLDB] Add type to the output for FieldDecl when logging in ClangASTSource::layoutRecordType

Shafik Yaghmour via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 26 11:17:52 PDT 2021


Author: Shafik Yaghmour
Date: 2021-08-26T11:17:47-07:00
New Revision: 2a4a498a884ad929dad5dc72e20c76adfecfc78c

URL: https://github.com/llvm/llvm-project/commit/2a4a498a884ad929dad5dc72e20c76adfecfc78c
DIFF: https://github.com/llvm/llvm-project/commit/2a4a498a884ad929dad5dc72e20c76adfecfc78c.diff

LOG: [LLDB] Add type to the output for FieldDecl when logging in ClangASTSource::layoutRecordType

I was debugging a problem and noticed that it would have been helpful to have
the type of each FieldDecl when looking at the output from
ClangASTSource::layoutRecordType.

Differential Revision: https://reviews.llvm.org/D108257

Added: 
    

Modified: 
    lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 58b6b625bfeca..ae93252e55212 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -1571,8 +1571,10 @@ bool ClangASTSource::layoutRecordType(const RecordDecl *record, uint64_t &size,
                                     fe = record->field_end();
          fi != fe; ++fi) {
       LLDB_LOG(log,
-               "LRT     (FieldDecl*){0}, Name = '{1}', Offset = {2} bits",
-               *fi, fi->getName(), field_offsets[*fi]);
+               "LRT     (FieldDecl*){0}, Name = '{1}', Type = '{2}', Offset = "
+               "{3} bits",
+               *fi, fi->getName(), fi->getType().getAsString(),
+               field_offsets[*fi]);
     }
     DeclFromParser<const CXXRecordDecl> parser_cxx_record =
         DynCast<const CXXRecordDecl>(parser_record);


        


More information about the lldb-commits mailing list