I am learning to write a kernel for qemu-x86. I defined a struct variable named k_tss in one of my .c files. I run qemu and connected it with gdb. Then I typed "break img_entry" and "c" Qemu stoped at img_entry(),but the gdb promted that it stoped in k_tss(). My OS : Debian-6.1 My Gcc: gcc version 4.4.5 (Debian 4.4.5-8) My Gdb: GNU gdb (GDB) 7.2-debian My Qemu: QEMU PC emulator version 0.12.5 (Debian 0.12.5+dfsg-3) Please turn to attachment for all my kernel sources. After uncompressing the tarball: 1, cd into its root directory 2, type "source config.mk" 3, type "source debug",then you'll get qemu up and connected to gdb 4, type "break img_entry" in gdb 5, type "c" 6, after the breakpoint is hitted,type "bt" and you'll see the trace of the stack is not as it really is.All the values are correct and what looks strange is the symbol resolved from those values.
Created attachment 5803 [details] All my kernel sources.
GDB developers may not have qemu installed on their machine, so it is hard to reproduce this problem as you suggested. AFAICS, the problem you want to fix has nothing to do with qemu, so If you can provide a simple test case, that is helpful to gdb hackers to understand what is the problem in gdb.
Hey,man!I really appreciate your patience for fixing this bug. I wonder if you could beg me a pardon that this 'bug' is entirely resulted from my code,not gdb's. I've already fixed it and everything has been working well.After all,thank you for replying to me and wish your a happy hacking :) -------------------------------- Much as formal systems, thanks to their very power, are doomed to incompleteness, so living beings, thanks to their complexity, are doomed to perish, each in its own unique manner. ----DOUGLAS HOFSTADTER
Close this PR.