Skip to content

Commit e27a17c

Browse files
JDevlieghereDanielCChen
authored andcommitted
[lldb] Fix a variety of LLDB_LOG format strings
LLVM now triggers an assertion when the format string and arguments don't match. Fix a variety of incorrect format strings I discovered when enabling logging with a debug build.
1 parent b82a207 commit e27a17c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
934934
QualType(interface_type, 0).getAsOpaquePtr(),
935935
function_decl_ctx.GetTypeSystem()->weak_from_this());
936936

937-
LLDB_LOG(log, " FEVD[{0}] Adding type for $__lldb_objc_class: {1}",
937+
LLDB_LOG(log, " FEVD Adding type for $__lldb_objc_class: {0}",
938938
ClangUtil::ToString(interface_type));
939939

940940
AddOneType(context, class_user_type);
@@ -974,7 +974,7 @@ void ClangExpressionDeclMap::LookUpLldbObjCClass(NameSearchContext &context) {
974974
if (!self_clang_type)
975975
return;
976976

977-
LLDB_LOG(log, " FEVD[{0}] Adding type for $__lldb_objc_class: {1}",
977+
LLDB_LOG(log, " FEVD Adding type for $__lldb_objc_class: {0}",
978978
ClangUtil::ToString(self_type->GetFullCompilerType()));
979979

980980
TypeFromUser class_user_type(self_clang_type);

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ uint32_t AppleObjCDeclVendor::FindDecls(ConstString name, bool append,
605605
if (log) {
606606
clang::QualType new_iface_type = ast_ctx.getObjCInterfaceType(iface_decl);
607607

608-
LLDB_LOG(log, "AOCTV::FT Created {1} (isa 0x{2:x})",
608+
LLDB_LOG(log, "AOCTV::FT Created {0} (isa 0x{1:x})",
609609
new_iface_type.getAsString(), (uint64_t)isa);
610610
}
611611

lldb/source/Target/ScriptedThreadPlan.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ void ScriptedThreadPlan::GetDescription(Stream *s,
184184
lldb::StreamSP stream = std::make_shared<lldb_private::StreamString>();
185185
llvm::Error err = m_interface->GetStopDescription(stream);
186186
if (err) {
187-
LLDB_LOG_ERROR(GetLog(LLDBLog::Thread), std::move(err),
188-
"Can't call ScriptedThreadPlan::GetStopDescription.");
187+
LLDB_LOG_ERROR(
188+
GetLog(LLDBLog::Thread), std::move(err),
189+
"Can't call ScriptedThreadPlan::GetStopDescription: {0}");
189190
s->Printf("Scripted thread plan implemented by class %s.",
190191
m_class_name.c_str());
191192
} else

0 commit comments

Comments
 (0)