This is an archive of the discontinued LLVM Phabricator instance.

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

Diff Detail

Repository
rLLDB LLDB

Event Timeline

martong created this revision.May 17 2019, 6:10 AM
JDevlieghere added inline comments.
lldb/source/Symbol/ClangASTImporter.cpp
956 ↗(On Diff #200028)

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

963 ↗(On Diff #200028)

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 ↗(On Diff #200028)

Sure, changed that.

963 ↗(On Diff #200028)

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 ↗(On Diff #200446)

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

974 ↗(On Diff #200446)

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()'
This revision was automatically updated to reflect the committed changes.