1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibELF+Utilities: Avoid truncating 64-bit values

This fixes displaying 64-bit addresses in readelf and also fixes
showing backtraces from core dumps on x86_64.
This commit is contained in:
Gunnar Beutner 2021-07-22 00:47:30 +02:00 committed by Andreas Kling
parent 36c3927169
commit db1c5c4830
6 changed files with 37 additions and 36 deletions

View file

@ -451,7 +451,7 @@ void DebugSession::update_loaded_libs()
if (file_or_error.is_error())
return IterationDecision::Continue;
FlatPtr base_address = entry.as_object().get("address").as_u32();
FlatPtr base_address = entry.as_object().get("address").to_addr();
auto debug_info = make<DebugInfo>(make<ELF::Image>(file_or_error.value()->bytes()), m_source_root, base_address);
auto lib = make<LoadedLibrary>(lib_name, file_or_error.release_value(), move(debug_info), base_address);
m_loaded_libraries.set(lib_name, move(lib));