qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Debugging with paging enabled


From: Marcel Kilgus
Subject: [Qemu-devel] Debugging with paging enabled
Date: Wed, 8 Nov 2006 03:30:19 +0100

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]