Skip to content

Commit 4cfc5b8

Browse files
authored
Merge pull request #3868 from apple/lldb-fix-log-message-in-resolveRemoteAddress
[lldb] Fix log messages in resolveRemoteAddress
2 parents 21db724 + 376bd66 commit 4cfc5b8

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ bool LLDBMemoryReader::readBytes(swift::remote::RemoteAddress address,
185185
llvm::Optional<Address> maybeAddr =
186186
resolveRemoteAddress(address.getAddressData());
187187
if (!maybeAddr) {
188-
LLDB_LOGV(log, "[MemoryReader] could not resolve address {1:x}",
188+
LLDB_LOGV(log, "[MemoryReader] could not resolve address {0:x}",
189189
address.getAddressData());
190190
return false;
191191
}
@@ -230,13 +230,13 @@ bool LLDBMemoryReader::readString(swift::remote::RemoteAddress address,
230230
std::string &dest) {
231231
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
232232

233-
LLDB_LOGV(log, "[MemoryReader] asked to read string data at address {0x}",
233+
LLDB_LOGV(log, "[MemoryReader] asked to read string data at address {0:x}",
234234
address.getAddressData());
235235

236236
llvm::Optional<Address> maybeAddr =
237237
resolveRemoteAddress(address.getAddressData());
238238
if (!maybeAddr) {
239-
LLDB_LOGV(log, "[MemoryReader] could not resolve address {1:x}",
239+
LLDB_LOGV(log, "[MemoryReader] could not resolve address {0:x}",
240240
address.getAddressData());
241241
return false;
242242
}
@@ -348,9 +348,9 @@ LLDBMemoryReader::resolveRemoteAddress(uint64_t address) const {
348348
// If the address is larger than anything we have mapped the address is out
349349
if (pair_iterator == m_range_module_map.end()) {
350350
LLDB_LOG(log,
351-
"[MemoryReader] Address {1:x} is larger than the upper bound "
352-
"address of the mapped in modules",
353-
address);
351+
"[MemoryReader] Address {0:x} is larger than the upper bound "
352+
"address of the mapped in modules",
353+
address);
354354
return {};
355355
}
356356

@@ -365,8 +365,8 @@ LLDBMemoryReader::resolveRemoteAddress(uint64_t address) const {
365365
file_address = address - std::prev(pair_iterator)->first;
366366

367367
LLDB_LOGV(log,
368-
"[MemoryReader] Successfully resolved mapped address {1:x} "
369-
"into file address {1:x}",
368+
"[MemoryReader] Successfully resolved mapped address {0:x} into "
369+
"file address {1:x}",
370370
address, file_address);
371371
auto *object_file = module->GetObjectFile();
372372
if (!object_file)
@@ -375,16 +375,16 @@ LLDBMemoryReader::resolveRemoteAddress(uint64_t address) const {
375375
Address resolved(file_address, object_file->GetSectionList());
376376
if (!resolved.IsValid()) {
377377
LLDB_LOG(log,
378-
"[MemoryReader] Could not make a real address out of file "
379-
"address {1:x} and object file {}",
378+
"[MemoryReader] Could not make a real address out of file address "
379+
"{0:x} and object file {1}",
380380
file_address, object_file->GetFileSpec().GetFilename());
381381
return {};
382382
}
383383

384384
LLDB_LOGV(log,
385-
"[MemoryReader] Unsuccessfully resolved mapped address {1:x} "
386-
"into file address {1:x}",
387-
address, address);
385+
"[MemoryReader] Successfully resolved mapped address {0:x} into "
386+
"file address {1:x}",
387+
address, resolved.GetFileAddress());
388388
return resolved;
389389
}
390390

0 commit comments

Comments
 (0)