This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix incorrect uses of LLDB_LOG_ERROR
ClosedPublic

Authored by JDevlieghere on Jul 5 2023, 10:46 AM.

Details

Summary

Fix incorrect uses of LLDB_LOG_ERROR. The macro doesn't automatically inject the error in the log message: it merely passes the error as the first argument to formatv and therefore must be referenced with {0}.

Thanks to Nicholas Allegra for collecting a list of places where the macro was misused.

rdar://111581655

Diff Detail

Event Timeline

JDevlieghere created this revision.Jul 5 2023, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 10:46 AM
JDevlieghere requested review of this revision.Jul 5 2023, 10:46 AM
bulbazord accepted this revision.Jul 5 2023, 11:13 AM

I was actually looking at this today independently, guess you beat me to the punch 😛 . LGTM modulo one comment.

lldb/source/Target/Target.cpp
2411–2415

No use of {0} here, so we're dropping the error message from the look of it?

This revision is now accepted and ready to land.Jul 5 2023, 11:13 AM
fdeazeve accepted this revision.Jul 5 2023, 11:22 AM

Nice catch!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 11:28 AM