panic: Do not print stacktrace if map file is not loaded. Fix places where we erroneously appended a newline to a panic string
This commit is contained in:
parent
85b4d063a8
commit
536a82627b
BIN
limine-pxe.bin
BIN
limine-pxe.bin
Binary file not shown.
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
BIN
stage2.map
BIN
stage2.map
Binary file not shown.
@ -52,7 +52,7 @@ static int cache_block(int drive, uint64_t block, int sector_size) {
|
||||
|
||||
if (r.eflags & EFLAGS_CF) {
|
||||
int ah = (r.eax >> 8) & 0xff;
|
||||
panic("Disk error %x. Drive %x, LBA %x.\n", ah, drive, dap->lba);
|
||||
panic("Disk error %x. Drive %x, LBA %x.", ah, drive, dap->lba);
|
||||
}
|
||||
|
||||
cached_block = block;
|
||||
@ -75,7 +75,7 @@ int disk_get_sector_size(int drive) {
|
||||
|
||||
if (r.eflags & EFLAGS_CF) {
|
||||
int ah = (r.eax >> 8) & 0xff;
|
||||
panic("Disk error %x. Drive %x.\n", ah, drive);
|
||||
panic("Disk error %x. Drive %x.", ah, drive);
|
||||
}
|
||||
|
||||
return drive_params.bytes_per_sect;
|
||||
|
@ -296,7 +296,7 @@ int ext2_open(struct ext2_file_handle *ret, struct part *part, const char *path)
|
||||
struct ext2_superblock *sb = &ret->sb;
|
||||
|
||||
if (sb->s_state == EXT2_FS_UNRECOVERABLE_ERRORS)
|
||||
panic("ext2: unrecoverable errors found\n");
|
||||
panic("ext2: unrecoverable errors found");
|
||||
|
||||
ret->block_size = ((uint64_t)1024 << ret->sb.s_log_block_size);
|
||||
|
||||
|
@ -45,8 +45,10 @@ char *trace_address(size_t *off, size_t addr) {
|
||||
}
|
||||
|
||||
void print_stacktrace(size_t *base_ptr) {
|
||||
if (!stage2_map)
|
||||
print("trace: Symbol names won't be resolved due to missing map file.\n");
|
||||
if (!stage2_map) {
|
||||
print("trace: Stack trace omitted due to unavailable map file.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (base_ptr == NULL) {
|
||||
asm volatile (
|
||||
|
@ -130,7 +130,7 @@ void stivale_load(char *config, char *cmdline) {
|
||||
|
||||
struct file_handle f;
|
||||
if (!uri_open(&f, module_file))
|
||||
panic("Requested module with path \"%s\" not found!\n", module_file);
|
||||
panic("Requested module with path \"%s\" not found!", module_file);
|
||||
|
||||
void *module_addr = (void *)(((uint32_t)top_used_addr & 0xfff) ?
|
||||
((uint32_t)top_used_addr & ~((uint32_t)0xfff)) + 0x1000 :
|
||||
|
@ -182,7 +182,7 @@ void stivale2_load(char *config, char *cmdline) {
|
||||
|
||||
struct file_handle f;
|
||||
if (!uri_open(&f, module_file))
|
||||
panic("Requested module with path \"%s\" not found!\n", module_file);
|
||||
panic("Requested module with path \"%s\" not found!", module_file);
|
||||
|
||||
void *module_addr = (void *)(((uint32_t)top_used_addr & 0xfff) ?
|
||||
((uint32_t)top_used_addr & ~((uint32_t)0xfff)) + 0x1000 :
|
||||
|
@ -28,7 +28,7 @@ void pxe_init(void) {
|
||||
|
||||
if (pxenv->version < 0x201) {
|
||||
//we won't support pxe < 2.1, grub does this too and it seems to work fine
|
||||
panic("\npxe version too old");
|
||||
panic("pxe version too old");
|
||||
}
|
||||
|
||||
struct bangpxe* bangpxe = (struct bangpxe*)((((pxenv->pxe_ptr & 0xffff0000) >> 16) << 4) + (pxenv->pxe_ptr & 0xffff));
|
||||
|
Loading…
Reference in New Issue
Block a user