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

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.Tue, May 21, 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.Tue, May 21, 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.Tue, May 21, 1:34 PM

LGTM outside of Jonas's comments.

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