Skip to content

[lldb] Fix log messages in resolveRemoteAddress #3868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions lldb/source/Plugins/LanguageRuntime/Swift/LLDBMemoryReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ bool LLDBMemoryReader::readBytes(swift::remote::RemoteAddress address,
llvm::Optional<Address> maybeAddr =
resolveRemoteAddress(address.getAddressData());
if (!maybeAddr) {
LLDB_LOGV(log, "[MemoryReader] could not resolve address {1:x}",
LLDB_LOGV(log, "[MemoryReader] could not resolve address {0:x}",
address.getAddressData());
return false;
}
Expand Down Expand Up @@ -184,13 +184,13 @@ bool LLDBMemoryReader::readString(swift::remote::RemoteAddress address,
std::string &dest) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));

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

llvm::Optional<Address> maybeAddr =
resolveRemoteAddress(address.getAddressData());
if (!maybeAddr) {
LLDB_LOGV(log, "[MemoryReader] could not resolve address {1:x}",
LLDB_LOGV(log, "[MemoryReader] could not resolve address {0:x}",
address.getAddressData());
return false;
}
Expand Down Expand Up @@ -302,9 +302,9 @@ LLDBMemoryReader::resolveRemoteAddress(uint64_t address) const {
// If the address is larger than anything we have mapped the address is out
if (pair_iterator == m_range_module_map.end()) {
LLDB_LOG(log,
"[MemoryReader] Address {1:x} is larger than the upper bound "
"address of the mapped in modules",
address);
"[MemoryReader] Address {0:x} is larger than the upper bound "
"address of the mapped in modules",
address);
return {};
}

Expand All @@ -319,8 +319,8 @@ LLDBMemoryReader::resolveRemoteAddress(uint64_t address) const {
file_address = address - std::prev(pair_iterator)->first;

LLDB_LOGV(log,
"[MemoryReader] Successfully resolved mapped address {1:x} "
"into file address {1:x}",
"[MemoryReader] Successfully resolved mapped address {0:x} into "
"file address {1:x}",
address, file_address);
auto *object_file = module->GetObjectFile();
if (!object_file)
Expand All @@ -329,16 +329,16 @@ LLDBMemoryReader::resolveRemoteAddress(uint64_t address) const {
Address resolved(file_address, object_file->GetSectionList());
if (!resolved.IsValid()) {
LLDB_LOG(log,
"[MemoryReader] Could not make a real address out of file "
"address {1:x} and object file {}",
"[MemoryReader] Could not make a real address out of file address "
"{0:x} and object file {1}",
file_address, object_file->GetFileSpec().GetFilename());
return {};
}

LLDB_LOGV(log,
"[MemoryReader] Unsuccessfully resolved mapped address {1:x} "
"into file address {1:x}",
address, address);
"[MemoryReader] Successfully resolved mapped address {0:x} into "
"file address {1:x}",
address, resolved.GetFileAddress());
return resolved;
}

Expand Down