Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GhdCu-0003jL-PY for qemu-devel@nongnu.org; Tue, 07 Nov 2006 21:30:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GhdCr-0003fz-PI for qemu-devel@nongnu.org; Tue, 07 Nov 2006 21:30:28 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GhdCr-0003ff-J4 for qemu-devel@nongnu.org; Tue, 07 Nov 2006 21:30:25 -0500 Received: from [212.227.126.183] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GhdCr-0006i1-8k for qemu-devel@nongnu.org; Tue, 07 Nov 2006 21:30:25 -0500 Date: Wed, 8 Nov 2006 03:30:19 +0100 From: Marcel Kilgus Message-ID: <1583108256.20061108033019@kilgus.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Debugging with paging enabled Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 hitting a huge problem. The kernel is loaded by GRUB at physical address 0x100000 and, IIRC like Linux, I simply remap that to be mirrored at 0xc0000000 using the page table. Afterwards I define my kernel code and data segments to be based there as well, so that all offsets in the code are still right. This works fine. But after these initialisations I have problems with breakpoints: (gdb) b timer_handler Breakpoint 1 at 0x108294: file cpu_x86.c, line 29. (gdb) c now never returns, even though the code does run. If I do (gdb) b *0xc0108294 Breakpoint 1 at 0xc0108294 (gdb) c Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. timer_handler at cpu_x86.c:71 I get the exception. Trying to continue with step or next results in a complete GDB crash. It only works properly if I set both breakpoints: (gdb) b timer_handler Breakpoint 1 at 0x108294: file cpu_x86.c, line 29. (gdb) b *0xc0108294 Breakpoint 2 at 0xc0108294 (gdb) c Continuing. Breakpoint 1, timer_handler at cpu_x86.c:71 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? Many thanks in advance, Marcel