Skip to content

Commit

Permalink
[LLDB] Add type to the output for FieldDecl when logging in ClangASTS…
Browse files Browse the repository at this point in the history
…ource::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
  • Loading branch information
shafik committed Aug 26, 2021
1 parent 1eb7536 commit 2a4a498
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 2a4a498

Please sign in to comment.