[Qemu-devel] Re: Debugging with paging enabled

2006-11-10 Thread Marcel Kilgus
Daniel Jacobowitz wrote: > I'd recommend the even simpler hack of having qemu report a PC that > included the segment base :-) Probably sounds easier than it is, as seen the serial protocol doesn't include the PC when a breakpoint fires. qemu would have to intentionally report a wrong EIP the next

[Qemu-devel] Re: Debugging with paging enabled

2006-11-10 Thread Marcel Kilgus
Paul Brook wrote: > As Dan said, gdb knows nothing about x86 segmentation. As soon as you have > nonzero segment bases you're pretty much on your own. I was just wondering, because I didn't invent that "move the code to 3GB base" but it is (was?) the model used by Linux, at least in very early ver

[Qemu-devel] Re: Debugging with paging enabled

2006-11-10 Thread Marcel Kilgus
andrzej zaborowski wrote: >> Well, that explains it then, I guess. In that case I don't really see >> a clean solution for it. > If I understand the problem, the clean solution is having the > debugging symbols at the right addresses: in code that runs with > paging enabled symbols should be at the

[Qemu-devel] Re: Debugging with paging enabled

2006-11-08 Thread Marcel Kilgus
Daniel Jacobowitz wrote: >> Leaving that aside, if I do set the breakpoint correctly at virtual >> address (e.g.) 0xC0123456 qemu will (correctly I guess) cause an >> exception for code offset 0x123456 (as CS base is 0xC000). GDB >> however then doesn't recognize its own breakpoint as it only r

[Qemu-devel] Re: Debugging with paging enabled

2006-11-08 Thread Marcel Kilgus
Fabrice Bellard wrote: > The breakpoints are set for a given virtual address. So IMHO testing > only the EIP value instead of EIP + CS.base is not logical... That I just check for EIP is a convenience for me. The code is linked to 0x0010 but moves itself to the virtual address 0xC010 (CS s

[Qemu-devel] Re: Debugging with paging enabled

2006-11-08 Thread Marcel Kilgus
/me wrote: > Having to always set them both in the high and low area is a bit > cumbersome to say the least. Any suggestion on what I'm missing or can > do to get breakpoints working properly again? Okay, the QEMU source code was a lot more readable than I expected it to be, so I had a look myself

[Qemu-devel] Debugging with paging enabled

2006-11-07 Thread Marcel Kilgus
Hi, I'm using QEMU 0.8.2 to debug a new experimental OS (x86) I'm currently writing for my university. So this is not based on Linux and the "-kernel" option, instead I use a floppy image and load my kernel using GRUB. Now debugging was a breeze so far, but while implementing virtual memory I'm h