Skip to content

Commit 1fe0889

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 bcf4f31 commit 1fe0889

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
@@ -662,7 +662,7 @@ bool SwiftUserExpression::Parse(DiagnosticManager &diagnostic_manager,
662662

663663
auto error = [&](const char *error_msg, const char *detail = nullptr) {
664664
if (detail)
665-
LLDB_LOG(log, "%s: %s", error_msg, detail);
665+
LLDB_LOG(log, "{0}: {1}", error_msg, detail);
666666
else
667667
LLDB_LOG(log, error_msg);
668668

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ TypeSystemSwiftTypeRef::ResolveTypeAlias(swift::Demangle::Demangler &dem,
596596
}
597597
NodePointer n = GetDemangledType(dem, desugared_name.GetStringRef());
598598
if (!n) {
599-
LLDB_LOG(GetLog(LLDBLog::Types), "Unrecognized demangling %s",
599+
LLDB_LOG(GetLog(LLDBLog::Types), "Unrecognized demangling {0}",
600600
desugared_name.AsCString());
601601
return {{}, {}};
602602
}

0 commit comments

Comments
 (0)