[Top][All Lists]

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

[Qemu-devel] Re: Single stepping MIPS in GDB

From: Dirk Behme
Subject: [Qemu-devel] Re: Single stepping MIPS in GDB
Date: Wed, 29 Mar 2006 15:40:35 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)


answering to myself again ;)

Now, I found where the PC is wrongly set to 0x0:

In translate-all.c, end of function cpu_restore_state() (lines
with '+' are debug output added):

#elif defined(TARGET_MIPS)
+ printf("PC before: 0x%08x, j: %d, OPC_BUF_SIZE: %d\n", env->PC, j, OPC_BUF_SIZE);
+    for(c = 0; c < OPC_BUF_SIZE; c++)
+      printf("OPC %03d: 0x%08x\n", c, gen_opc_pc[c]);
    env->PC = gen_opc_pc[j];
+    printf("PC after: 0x%08x\n", env->PC);
    env->hflags &= ~MIPS_HFLAG_BMASK;
    env->hflags |= gen_opc_hflags[j];

results in the following output (0x80010400 is the correct one):

PC before: 0x80010400, j: -8185, OPC_BUF_SIZE: 512
OPC 000: 0x00000000
OPC 001: 0x00000000
OPC 510: 0x00000000
OPC 511: 0x00000000
PC after: 0x00000000

If I temporarily delete the line "env->PC = gen_opc_pc[j];"
single stepping seems to work.

Seems that gen_opc_pc is all 0, and j looks strange. But I don't know whats wrong here? ;(

Best regards


Dirk Behme wrote:

I try to debug some low level system init code on MIPS as well. For this, I use qemu-snapshot-2006-03-21_23 because this already includes little endian MIPS (--target-list=mipsel-softmmu). I can load my program to MIPS default start address 0x80010000, use mipsel-linux-gdb to attach to it and load symbols. Start address is set correctly. But seems that I have trouble single stepping (si). I would assume that with first si system should jump to 0x80010400 (please find some debug output below). Instead, PC is set to 0x0.

*1* Debug output for single step at startup. PC is set to 0x0 instead to next command at 0x80010400

_start ()
    at uboot/u-boot-1.1.4/cpu/mips/start.S:43
43              RVECENT(reset,0)        /* U-boot entry point */
(gdb) p/x $pc
$1 = 0x80010000
(gdb) x/2i $pc
0x80010000 <_start>:    b       0x80010400 <reset>
0x80010004 <_start+4>:  nop
(gdb) si
0x00000000 in ?? ()
(gdb) p/x $pc
$2 = 0x0

reply via email to

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