feat: small code optimisations

This commit is contained in:
2022-05-14 16:59:04 +02:00
parent 6d898c07e8
commit e850dabc8b
6 changed files with 13 additions and 17 deletions

View File

@@ -24,7 +24,7 @@ static const char *elf_name_strtab = ".strtab";
struct stackframe {
struct stackframe *ebp;
uint32_t eip;
uintptr_t eip;
};
char *debug_get_shstrtab_entry(uint32_t ndx) {
@@ -80,7 +80,7 @@ void debug_store_info(struct multiboot_info *info) {
debug_find_sections(info->u.elf_sec.shndx);
}
struct elf32_symtab_entry *debug_get_entry_for_addr(uint32_t addr) {
struct elf32_symtab_entry *debug_get_entry_for_addr(uintptr_t addr) {
if (elf_symtab == NULL) {
return NULL;
}
@@ -106,9 +106,9 @@ void debug_backtrace(bool do_sync) {
while (frame->ebp != NULL) {
struct elf32_symtab_entry *entry = debug_get_entry_for_addr(frame->eip);
if (entry == NULL) {
sprintf(msg, "#unknown (%x)\n", frame->eip);
sprintf(msg, "#unknown (%lx)\n", frame->eip);
} else {
sprintf(msg, "%s (%x)\n", debug_get_strtab_entry(entry->st_name), frame->eip);
sprintf(msg, "%s (%lx)\n", debug_get_strtab_entry(entry->st_name), frame->eip);
};
printer(msg);
frame = frame->ebp;