Ubuntu GDB debug KVM Ubuntu guest kernel

Опубликовано: 31 Октябрь 2019
на канале: BPFire
1k
13





1 add qemu argument -s so qemu gdbserver listening on port 1234
2 install guest kernel debug symbol package on guest (kernel 4.4.0)
3 copy installed kernel symbol package /usr/lib/debug to gdb host /usr/src/debug
4 get guest kernel source code kernel linux-4.4 and copy to gdb host /usr/src/
5 on gdb host at /usr/src directory: gdb -tui /usr/src/debug/boot/vmlinux-4.4.0-87-generic
6 in gdb:target remote :1234
7 in gdb: set substitute-path /build/linux-xxxxx/linux-4.4.0/ .