mstorsjo marked an inline comment as done.
mstorsjo added inline comments.

================
Comment at: lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:175-179
+    std::string msg = errorToErrorCode(binary.takeError()).message();
+    LLDB_LOGF(log,
+              "ObjectFilePECOFF::GetModuleSpecifications() - failed to create 
binary "
+              "for file (%s): %s",
+              file ? file.GetPath().c_str() : "<NULL>", msg.c_str());
----------------
labath wrote:
> There's an LLDB_LOG_ERROR macro, which makes sure to "handle" the error even 
> if logging is disabled. It also handles all the `.c_str()` stuff *and* is 
> able to prepend the name of the caller to the log message (if one requests 
> that when enabling logging). So, overall, this could just be:
> `LLDB_LOG_ERROR(log, binary.takeError(), "Failed to create binary for file 
> ({1}): {0}", file)`
Oh, awesome, that's much neater.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69646/new/

https://reviews.llvm.org/D69646



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to