help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GRUB2: Keeping debug symbols in an image


From: Adrian Burns
Subject: Re: GRUB2: Keeping debug symbols in an image
Date: Fri, 17 Feb 2012 10:48:14 +0000

Jordan, thanks for the response..

we got around that by finding the address of the _start function in
the grub.elf (produced by "ld" see below)
# nm grub.elf | grep _start
then subtracting this address from the address of the _start function
at runtime to give us the correct offset
grub_printf ("\n\nWelcome to GRUB! - _start @ 0x%08x \n", (unsigned
int)&_start);

this gives a proper offset into the grub kernel.exec module (so i can
debug the kernel.exec module) but i cant set breakpoints in any of the
other loaded modules unless i do the same thing on a module by module
basis...

im just trying to debug GRUB in general and i have JTAG/ITP hardware
on my desk, so you use grub_printf() for debug then?




############## producing elf to match a grub.efi built by grub-mkimage
 ld -Bsymbolic -shared -nostdlib -znocombreloc -o grub.efi
grub-core/kernel.exec grub-core/fat.mod grub-core/boot.mod
grub-core/linux.mod grub-core/serial.mod grub-core/part_msdos.mod
grub-core/normal.mod grub-core/mmap.mod grub-core/relocator.mod
grub-core/video.mod grub-core/extcmd.mod grub-core/terminfo.mod
grub-core/terminal.mod grub-core/crypto.mod grub-core/bufio.mod
grub-core/font.mod grub-core/bitmap.mod grub-core/bitmap_scale.mod
grub-core/gfxterm.mod -m elf_i386








On Fri, Feb 17, 2012 at 12:18 AM, Jordan Uggla <address@hidden> wrote:
> On Mon, Feb 13, 2012 at 2:16 AM, Adrian Burns <address@hidden> wrote:
>> Hi,
>>
>> Im looking for GRUB2's grub-mkimage to produce an efi file for target
>> execution along with a matching elf file that has all the debug
>> symbols included so that i can use a debugger to step through the
>> GRUB2 code.
>
> On EFI, you can't know ahead of time at what address the firmware will
> load grub.efi so you can't transform between addresses and symbols.
> That means that you simply can't use gdb with [U]EFI, even with debug
> symbols included.
>
> What specifically are you trying to debug?
>
> --
> Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]