Configure gdb for qemu
Compile code with gdb #
Enable layout src
when you use gdb.
CFLAGS = -ggdb
Add flag to qemu #
qemu-system-aarch64 -M raspi3b -s -S -kernel kernel.img
Create .gdbinit
under project folders
#
- Connect gdb on
127.0.0.1:1234
- Symbol-file enables
breakpoint
in gdb
set architecture aarch64
target remote 127.0.0.1:1234
symbol-file kernel.elf
Run qemu with gdb #
make qemu-gdb
# Run on another window
gdb-multiarch -x .gdbinit
# Start using gdb
b printk
layout src
c