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

LibELF: Remove ELF::Loader and move everyone to ELF::Image

This commit gets rid of ELF::Loader entirely since its very ambiguous
purpose was actually to load executables for the kernel, and that is
now handled by the kernel itself.

This patch includes some drive-by cleanup in LibDebug and CrashDaemon
enabled by the fact that we no longer need to keep the ref-counted
ELF::Loader around.
This commit is contained in:
Andreas Kling 2020-12-25 02:14:56 +01:00
parent 7551a66f73
commit 1e4c010643
24 changed files with 178 additions and 318 deletions

View file

@ -35,9 +35,9 @@
namespace Debug {
DebugInfo::DebugInfo(NonnullRefPtr<const ELF::Loader> elf)
: m_elf(elf)
, m_dwarf_info(Dwarf::DwarfInfo::create(m_elf))
DebugInfo::DebugInfo(NonnullOwnPtr<const ELF::Image> elf)
: m_elf(move(elf))
, m_dwarf_info(*m_elf)
{
prepare_variable_scopes();
prepare_lines();
@ -45,7 +45,7 @@ DebugInfo::DebugInfo(NonnullRefPtr<const ELF::Loader> elf)
void DebugInfo::prepare_variable_scopes()
{
m_dwarf_info->for_each_compilation_unit([&](const Dwarf::CompilationUnit& unit) {
m_dwarf_info.for_each_compilation_unit([&](const Dwarf::CompilationUnit& unit) {
auto root = unit.root_die();
parse_scopes_impl(root);
});
@ -102,7 +102,7 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
void DebugInfo::prepare_lines()
{
auto section = m_elf->image().lookup_section(".debug_line");
auto section = elf().lookup_section(".debug_line");
if (section.is_undefined())
return;