Debugging C: GDB returns "address where <file> has been loaded is missing"
Asked Answered
B

1

0

I'm very new to the C language and have been tasked with modifying GRUB. What a way to learn, right? Anyway, I'm trying to debug my modified GRUB using VMWare and GDB. I've been able to get the debugger working before, but for some reason, every time I load up my VM and connect GDB, during the loading process of GRUB, I get:

.loadsym.gdb:1: Error in sourced command file:
The address where biosdisk.module has been loaded is missing

and I have no idea what to do about it. My first thought was, "Oh, I'll just add-symbol-file <file> and that'll fix it!" but apparently that tells GDB to forget every other symbol it loaded???? So I can't add the symbol-file and set a breakpoint.

My googling only returns one semi-relevant post that doesn't really go all that in-depth on fixing the issue.

This output may also be relevant.

info file biosdisk.module
Symbols from "H:\Workspace\GRUB\Bootloader\Trunk\grub-core\kernel.exec".
Remote serial target in gdb-specific protocol:
Debugging a target over a serial line.
        While running this, GDB does not access memory from...
Local exec file:
        `H:\Workspace\GRUB\Bootloader\Trunk\grub-core\kernel.exec', file type elf32-i386.
        Entry point: 0x9000
        0x00009000 - 0x0000e6e0 is .text
        0x0000e6e0 - 0x0000f68d is .rodata
        0x0000f6a0 - 0x0000fe74 is .data
        0x0000fe80 - 0x000175d4 is .bss
Birthstone answered 11/3, 2020 at 19:23 Comment(1)
how to update grubMarshland
B
0

Ended up being that my codebase wasn't the same. That is, on my Windows host, I had one copy of my code and on my Ubuntu VM was another.

Using version control solved this issue.

Birthstone answered 11/3, 2020 at 23:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.