Debugging with QEMU&GDB, frames problem
Posted: Mon Apr 22, 2013 1:15 pm
Hi guys,
I've asked this on #osdev yesterday but nobody was able to help me. I am currently trying to debug my OS, which is loaded by a custom bootloader as a flat binary at address 0xC0000000. The code is working fine, the problem is that I cannot attach the QEMU process and load the object file to debug with both symbols and source code, since each time I enter a function that takes arguments, I end up with error messages like:
I'm linking with the following script, and then apply an objcopy -O binary to the resulting ELF file.
All object files compiled via GCC contains both rel.eh_frame and eh_frame sections, the ASM ones none of those. However, the resulting kernel.o object file only contains a tiny (8 bytes) eh_frame section and no rel.eh_frame section. I've tried googling the previous error but there was no help to be found.
Some help would be greatly appreciated, I don't see what I missed!
Thanks again for reading,
m4nny,
I've asked this on #osdev yesterday but nobody was able to help me. I am currently trying to debug my OS, which is loaded by a custom bootloader as a flat binary at address 0xC0000000. The code is working fine, the problem is that I cannot attach the QEMU process and load the object file to debug with both symbols and source code, since each time I enter a function that takes arguments, I end up with error messages like:
Code: Select all
setup_frames (mem_size=<error reading variable: can't compute CFA for this frame>) at frames.c:79
Code: Select all
ENTRY(entry)
ker_off = 0xc0000000;
SECTIONS
{
. = 0x0;
.text ker_off : AT(ker_off)
{
code = .;
objs/asm_entry.o(.text);
*(.text)
*(.rodata)
. = ALIGN(0x10);
}
.data : AT(ker_off + (data - code))
{
data = .;
*(.data)
. = ALIGN(0x10);
}
.bss : AT(ker_off + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(0x10);
}
.eh_frame : AT(ker_off + (eh_frame - code))
{
eh_frame = .;
*(.eh_frame);
*(.rel.eh_frame);
. = ALIGN(0x10);
}
.rel.eh_frame : AT(ker_off + (rel_eh_frame - code))
{
rel_eh_frame = .;
*(.rel.eh_frame);
. = ALIGN(0x10);
}
ker_end = .;
}
Some help would be greatly appreciated, I don't see what I missed!
Thanks again for reading,
m4nny,