mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 05:57:41 +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 size() const { return m_section_header.sh_size; }
|
||||
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; }
|
||||
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; }
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
char* symbol_ptr(const char* name);
|
||||
LinearAddress entry() const { return m_image.entry(); }
|
||||
|
||||
bool has_symbols() const { return m_image.symbol_count(); }
|
||||
|
||||
String symbolicate(dword address) const;
|
||||
|
||||
private:
|
||||
|
|
|
@ -115,10 +115,10 @@ static void load_ksyms_from_data(const ByteBuffer& buffer)
|
|||
if (!symbol.address)
|
||||
break;
|
||||
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());
|
||||
} else {
|
||||
dbgprintf("%p (no ELF loader for process)\n", symbol.address);
|
||||
dbgprintf("%p (no ELF symbols for process)\n", symbol.address);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue