mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 12:49:08 +00:00
LibDebug: Assert that we can read the executable of the debugee
This commit is contained in:
@@ -30,12 +30,19 @@
|
||||
|
||||
DebugSession::DebugSession(int pid)
|
||||
: m_debugee_pid(pid)
|
||||
, m_executable(String::format("/proc/%d/exe", pid))
|
||||
, m_elf(ELF::Loader::create(reinterpret_cast<u8*>(m_executable.data()), m_executable.size()))
|
||||
, m_executable(initialize_executable_mapped_file(pid))
|
||||
, m_elf(ELF::Loader::create(reinterpret_cast<const u8*>(m_executable->data()), m_executable->size()))
|
||||
, m_debug_info(m_elf)
|
||||
{
|
||||
}
|
||||
|
||||
NonnullOwnPtr<const MappedFile> DebugSession::initialize_executable_mapped_file(int pid)
|
||||
{
|
||||
auto executable = adopt_own(*new MappedFile(String::format("/proc/%d/exe", pid)));
|
||||
ASSERT(executable->is_valid());
|
||||
return executable;
|
||||
}
|
||||
|
||||
DebugSession::~DebugSession()
|
||||
{
|
||||
for (const auto& bp : m_breakpoints) {
|
||||
|
||||
Reference in New Issue
Block a user