mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 08:27:35 +00:00
Kernel: Fail a bit more gracefully when we don't have userspace symbols.
This commit is contained in:
parent
a4e48dce77
commit
316fb624f7
3 changed files with 5 additions and 3 deletions
|
@ -86,7 +86,7 @@ public:
|
||||||
unsigned offset() const { return m_section_header.sh_offset; }
|
unsigned offset() const { return m_section_header.sh_offset; }
|
||||||
unsigned size() const { return m_section_header.sh_size; }
|
unsigned size() const { return m_section_header.sh_size; }
|
||||||
unsigned entry_size() const { return m_section_header.sh_entsize; }
|
unsigned entry_size() const { return m_section_header.sh_entsize; }
|
||||||
unsigned entry_count() const { return size() / entry_size(); }
|
unsigned entry_count() const { return !entry_size() ? 0 : size() / entry_size(); }
|
||||||
dword address() const { return m_section_header.sh_addr; }
|
dword address() const { return m_section_header.sh_addr; }
|
||||||
const char* raw_data() const { return m_image.raw_data(m_section_header.sh_offset); }
|
const char* raw_data() const { return m_image.raw_data(m_section_header.sh_offset); }
|
||||||
bool is_undefined() const { return m_section_index == SHN_UNDEF; }
|
bool is_undefined() const { return m_section_index == SHN_UNDEF; }
|
||||||
|
|
|
@ -18,6 +18,8 @@ public:
|
||||||
char* symbol_ptr(const char* name);
|
char* symbol_ptr(const char* name);
|
||||||
LinearAddress entry() const { return m_image.entry(); }
|
LinearAddress entry() const { return m_image.entry(); }
|
||||||
|
|
||||||
|
bool has_symbols() const { return m_image.symbol_count(); }
|
||||||
|
|
||||||
String symbolicate(dword address) const;
|
String symbolicate(dword address) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -115,10 +115,10 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
||||||
if (!symbol.address)
|
if (!symbol.address)
|
||||||
break;
|
break;
|
||||||
if (!symbol.ksym) {
|
if (!symbol.ksym) {
|
||||||
if (current->process().elf_loader()) {
|
if (current->process().elf_loader() && current->process().elf_loader()->has_symbols()) {
|
||||||
dbgprintf("%p %s\n", symbol.address, current->process().elf_loader()->symbolicate(symbol.address).characters());
|
dbgprintf("%p %s\n", symbol.address, current->process().elf_loader()->symbolicate(symbol.address).characters());
|
||||||
} else {
|
} else {
|
||||||
dbgprintf("%p (no ELF loader for process)\n", symbol.address);
|
dbgprintf("%p (no ELF symbols for process)\n", symbol.address);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue