mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 13:14:15 -04:00
creport: Pretty-print addresses whenever possible.
This commit is contained in:
parent
5993614c2e
commit
a811b447ce
6 changed files with 38 additions and 12 deletions
|
@ -125,4 +125,17 @@ void CodeList::GetCodeInfoBuildId(u64 debug_handle, u64 rodata_addr, u8 *build_i
|
|||
memcpy(build_id, last_pages + ofs + 4, 0x20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const char *CodeList::GetFormattedAddressString(u64 address) {
|
||||
memset(this->address_str_buf, 0, sizeof(this->address_str_buf));
|
||||
for (unsigned int i = 0; i < this->code_count; i++) {
|
||||
if (this->code_infos[i].start_address <= address && address < this->code_infos[i].end_address) {
|
||||
snprintf(this->address_str_buf, sizeof(this->address_str_buf) - 1, "%016lx (%s + 0x%lx)", address, this->code_infos[i].name, address - this->code_infos[i].start_address);
|
||||
return this->address_str_buf;
|
||||
}
|
||||
}
|
||||
snprintf(this->address_str_buf, sizeof(this->address_str_buf) - 1, "%016lx", address);
|
||||
return this->address_str_buf;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue