Hello. Engaged in the development of simple wasps. Faced a problem: I can't upload debug information files to gdb. There are a dozen files that are compiled into separate .o files and then linked into one binary.
G ++ command line
g++ -c -g -m32 -nostdlib -nostartfiles -nodefaultlibs Command line ld
ld -T src/kernel/link.ld -o bin/kernel.bin $(KERNEL_OBJ_LINK_LIST) link.ld
ENTRY(kernel_start) SECTIONS { . = 0x00100000; ___kern_mem_start = .; .text : { *(.text) } .rodata : { *(.rodata) } .data : { *(.data) } .bss : { *(.bss) } ___kern_mem_end = .; _mem_null = .; } Now, launching gdb and joining qemu, I want to set a breakpoint on any function, but I can’t because gdb writes that debug information is not loaded. How do I download this information? I tried to specify gdb
file bin/kernel.bin but gdb writes that it cannot find debugging information there despite the -g flag in g ++.
Update .
I load symbols from the file prepared via objdump. When loading, it still writes that the characters were not loaded, but at the same time I can put a breakpoint on the function. The problem now is that this breakpoint doesn't work. Any idea what the problem is?