[Lldb-commits] [PATCH] D108257: Add type to the output for FieldDecl when logging in ClangASTSource::layoutRecordType

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 17 17:15:02 PDT 2021


shafik created this revision.
shafik added reviewers: teemperor, aprantl.
shafik requested review of this revision.

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`


https://reviews.llvm.org/D108257

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


Index: lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -1571,8 +1571,8 @@
                                     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108257.367063.patch
Type: text/x-patch
Size: 834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210818/d440d458/attachment.bin>


More information about the lldb-commits mailing list