Page MenuHomePhabricator

Add AST logging
ClosedPublic

Authored by martong on May 17 2019, 6:10 AM.

Details

Summary

Log the AST of the TU associated with LLDB's expr command, once a declaration
is completed

Event Timeline

martong created this revision.May 17 2019, 6:10 AM
JDevlieghere added inline comments.
lldb/source/Symbol/ClangASTImporter.cpp
956

Why not if (Log* log_ast = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_AST))

963

You can use the LLDB_LOG macro which provides a much nicer interface.

martong updated this revision to Diff 200446.May 21 2019, 2:58 AM
martong marked 4 inline comments as done.
  • Change to if(Log *log = ...)
  • Use LLDB_LOG
lldb/source/Symbol/ClangASTImporter.cpp
956

Sure, changed that.

963

Ok thanks for pointing it out. Changed to use it.

JDevlieghere added inline comments.May 21 2019, 8:40 AM
lldb/source/Symbol/ClangASTImporter.cpp
968

The macro uses llvm's format library, so you can omit the calls to .cstr().

974

Same here

shafik accepted this revision.May 21 2019, 1:34 PM

LGTM outside of Jonas's comments.

This revision is now accepted and ready to land.May 21 2019, 1:34 PM
martong updated this revision to Diff 200666.May 22 2019, 2:00 AM
  • Remove superflous '.c_str()'
Closed by commit rLLDB361362: Add AST logging (authored by martong, committed by ). · Explain WhyMay 22 2019, 2:08 AM
This revision was automatically updated to reflect the committed changes.