I am using gdb to debug boot loader code in xv6. In bootasm.S
, I can use gdb to debug assembly code as expected. Then at the end of bootasm.S
, we will call bootmain
(line 9168, call bootmain) and the execution will go into the bootmain
function of the C code bootmain.c. Since it is a C code, I wish to step over the C statements instead of assembly. I know that the step
command of gdb is for this purpose, but after I input 's', I received an error message: Cannot find bounds of current function. The same error shows up no matter I input 's' before or after the call bootmain
instruction. So, is it possible to step C statements in gdb when the execution switches from an assembly source to a C source like the situation described above? If it is, how to do that? Thank you.
PS1: The list command only list the main() source of the kernel.
PS2: The remote terminal ran make qemu-gdb
to start the QEMU, and the local terminal ran gdb kernel
to start the debug session, following steps here. I think the C source code symbols like bootmain function should be included so I should be able to step the C code in it.
Thank you again for your help!