Kernel+LibELF: Use hex instead of decimal for stack offsets in back traces (#4728)

Hex is the de facto format for representing memory addresses, make backtraces
conform to that convention.
This commit is contained in:
Brian Gianforcaro 2021-01-02 00:38:43 +00:00 committed by GitHub
parent 8161c99da2
commit 84c2be604a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: sideshowbarker 2024-07-19 00:13:29 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -171,7 +171,7 @@ NEVER_INLINE static void dump_backtrace_impl(FlatPtr base_pointer, bool use_ksym
if (symbol.symbol->address == g_highest_kernel_symbol_address && offset > 4096)
dbgln("{:p}", symbol.address);
else
dbgln("{:p} {} +{}", symbol.address, demangle(symbol.symbol->name), offset);
dbgln("{:p} {} +0x{:x}", symbol.address, demangle(symbol.symbol->name), offset);
}
}

View file

@ -397,7 +397,7 @@ String Image::symbolicate(u32 address, u32* out_offset) const
*out_offset = address - symbol.address;
return demangled_name;
}
return String::format("%s +%u", demangled_name.characters(), address - symbol.address);
return String::format("%s +0x%x", demangled_name.characters(), address - symbol.address);
}
}
if (out_offset)