Page 2 of 2

Re: Gdb "ignores" breakpoints when linking text to 0xC0000000

Posted: Thu Nov 06, 2008 12:55 pm
by hrniels
hm..no, that's not the problem. QEMU doesn't crash here. Perhaps Walling has put "higherhalf" to .setup instead of .text?
However, the problem is "just" that breakpoints do not work within the higherhalf -> main -> ... call-hierarchie. So as if gdb doesn't like the gdt-change within the loader-function. As I've mentioned above, breakpoints work for example within the interrupt-handling.

hrniels

Edit: Oh, I have just figured out that the breakpoints just don't work within the temporary GDT with a base of 0x40000000. As soon as the GDT is reset to a flat address-space (and paging is enabled), everything works fine. Sorry that I didn't get that earlier :oops: That makes sense, somehow, of course.
So I don't know if there actually is a solution for it (maybe other people using this strategy simply live with it because it isn't much code where breakpoints don't work). But of course it would be nice if there is any :)
In any case, thank you very much for your help! :)

Re: Gdb "ignores" breakpoints when linking text to 0xC0000000

Posted: Thu Nov 06, 2008 1:23 pm
by Walling
hrniels wrote:hm..no, that's not the problem. QEMU doesn't crash here. Perhaps Walling has put "higherhalf" to .setup instead of .text?
Yeah, that was my fault.
hrniels wrote:However, the problem is "just" that breakpoints do not work within the higherhalf -> main -> ... call-hierarchie. So as if gdb doesn't like the gdt-change within the loader-function. As I've mentioned above, breakpoints work for example within the interrupt-handling.
If you put loader in the .setup section you can set a breakpoint on that location. From that point you can single-step through your kernel. GDB will recognize where you set breakpoints (prints "Breakpoint reached...") on other symbols like higherhalf and main. Not that it is a solution to your problem, because you have to single-step. Maybe GDB will play with you again after paging is setup? If that is the case you just have to use the single-step debug solution until your paging works.

Re: Gdb "ignores" breakpoints when linking text to 0xC0000000

Posted: Thu Nov 06, 2008 1:29 pm
by hrniels
Walling wrote:If you put loader in the .setup section you can set a breakpoint on that location. From that point you can single-step through your kernel. GDB will recognize where you set breakpoints (prints "Breakpoint reached...") on other symbols like higherhalf and main. Not that it is a solution to your problem, because you have to single-step. Maybe GDB will play with you again after paging is setup? If that is the case you just have to use the single-step debug solution until your paging works.
Yes, that's true (see edit in my post above). I think I can live with it. Thanks :)

hrniels