Skip to content

Commit be39030

Browse files
committed
[lldb] Fix LLDB_LOG with format specifier argument
LLDB_LOG formats strings by specifying the positions of the argument ({0}, {1}, etc), and not with format specifiers (%s, %i, etc). rdar://117504055
1 parent 70c5513 commit be39030

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager,
667667

668668
auto error = [&](const char *error_msg, const char *detail = nullptr) {
669669
if (detail)
670-
LLDB_LOG(log, "%s: %s", error_msg, detail);
670+
LLDB_LOG(log, "{0}: {1}", error_msg, detail);
671671
else
672672
LLDB_LOG(log, error_msg);
673673

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeDynamicTypeResolution.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ SwiftLanguageRuntimeImpl::GetNumChildren(CompilerType type,
661661
if (auto *rti =
662662
llvm::dyn_cast_or_null<swift::reflection::RecordTypeInfo>(cti)) {
663663
LLDB_LOG(GetLog(LLDBLog::Types),
664-
"%s: class RecordTypeInfo(num_fields=%i)",
664+
"{0}: class RecordTypeInfo(num_fields=%i)",
665665
type.GetMangledTypeName().GetCString(), rti->getNumFields());
666666

667667
// The superclass, if any, is an extra child.
@@ -673,7 +673,7 @@ SwiftLanguageRuntimeImpl::GetNumChildren(CompilerType type,
673673
return {};
674674
}
675675
// FIXME: Implement more cases.
676-
LLDB_LOG(GetLog(LLDBLog::Types), "%s: unimplemented type info",
676+
LLDB_LOG(GetLog(LLDBLog::Types), "{0}: unimplemented type info",
677677
type.GetMangledTypeName().GetCString());
678678
return {};
679679
}

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ TypeSystemSwiftTypeRef::ResolveTypeAlias(swift::Demangle::Demangler &dem,
589589
}
590590
NodePointer n = GetDemangledType(dem, desugared_name.GetStringRef());
591591
if (!n) {
592-
LLDB_LOG(GetLog(LLDBLog::Types), "Unrecognized demangling %s",
592+
LLDB_LOG(GetLog(LLDBLog::Types), "Unrecognized demangling {0}",
593593
desugared_name.AsCString());
594594
return {{}, {}};
595595
}

0 commit comments

Comments
 (0)