mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 13:55:08 +00:00
ProfileViewer: Don't crash when we can't disassemble something
This commit is contained in:
parent
8daddcfa0a
commit
dccfff8c19
1 changed files with 6 additions and 0 deletions
|
@ -55,9 +55,15 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
|
|||
, m_node(node)
|
||||
{
|
||||
m_file = make<MappedFile>(profile.executable_path());
|
||||
|
||||
if (!m_file->is_valid())
|
||||
return;
|
||||
|
||||
auto elf_loader = make<ELF::Loader>((const u8*)m_file->data(), m_file->size());
|
||||
|
||||
auto symbol = elf_loader->find_symbol(node.address());
|
||||
if (!symbol.has_value())
|
||||
return;
|
||||
ASSERT(symbol.has_value());
|
||||
|
||||
auto view = symbol.value().raw_data();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue