Skip to content

Commit 0dff8cb

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 (cherry picked from commit be39030)
1 parent cb9f72f commit 0dff8cb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ TypeSystemSwiftTypeRef::ResolveTypeAlias(swift::Demangle::Demangler &dem,
611611
}
612612
NodePointer n = GetDemangledType(dem, desugared_name.GetStringRef());
613613
if (!n) {
614-
LLDB_LOG(GetLog(LLDBLog::Types), "Unrecognized demangling %s",
614+
LLDB_LOG(GetLog(LLDBLog::Types), "Unrecognized demangling {0}",
615615
desugared_name.AsCString());
616616
return {{}, {}};
617617
}

0 commit comments

Comments
 (0)