[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[openrisc] Problems debugging OpenRISC target
I have looked into this in a bit more detail.
1) Still perplexed by why it can't understand 'print my_data'
2) I can see why it's reading wrong results for auto variables as the
registers are getting mixed up. I see the following:
Sending packet: $Hc-1#09...Ack
Packet received:
Sending packet: $qC#b4...Ack
Packet received:
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $?#3f...Ack
Packet received: S05
Sending packet: $Hg0#df...Ack
Packet received:
Sending packet: $g#67...Ack
Packet received:
0000000000009244000000000008000400000004000000020000823800000001000000010000
12a4000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000041dc000000000000
00010000000000009240000000000000623800008201
0x00006238 in __breakinst () at
/home/sheaf/ecos-sr/ecos/packages/hal/common/current/src/hal_stub.c:569
569 HAL_BREAKPOINT(_breakinst);
(gdb) info reg
R0 R1 R2 R3 R4 R5 R6
R7
00000000 00009244 00000000 00080004 00000004 00000002 00008238
00000001
R8 R9 R10 R11 R12 R13 R14
R15
00000001 000012a4 00000000 00000000 00000000 00000000 00000000
00000000
R16 R17 R18 R19 R20 R21 R22
R23
00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
R24 R25 R26 R27 R28 R29 R30
R31
00000000 00000000 000041dc 00000000 00000001 00000000 00009240
00000000
PC SR EPCR
00006238 00008201 00000000
----> Here the registers look OK.
(gdb) step
Sending packet: $Hc0#db...Ack
Packet received:
Sending packet: $s#73...Ack
Packet received: T0540:0000623c;01:00009244;
Sending packet: $s#73...Ack
Packet received: T0540:000012a4;01:00009248;
Sending packet: $g#67...Ack
Packet received:
0000924400009248000800040008000400000004000000020000823800000001000000010000
12a4000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000012a400008201
cyg_start () at hello.c:15
15 ulMask = 1;
(gdb) info reg
R0 R1 R2 R3 R4 R5 R6
R7
00009244 00009248 00080004 00080004 00000004 00000002 00008238
00000001
R8 R9 R10 R11 R12 R13 R14
R15
00000001 000012a4 00000000 00000000 00000000 00000000 00000000
00000000
R16 R17 R18 R19 R20 R21 R22
R23
00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
R24 R25 R26 R27 R28 R29 R30
R31
00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000
PC SR EPCR
000012a4 00008201 00000000
(gdb)
----> But here there seems to be some corruption going on. R3 and above look
plausible but R0 should definitely not be 0x00009244 (should be 0x0) and R2
(the frame pointer) has also seems to have become corrupted (well at least
as it's reported). So GDB works out the address of the auto variable
completely wrongly.
Anyone any idea why this might be happening? I am still trawling through the
eCos code but it's hard going. Any advice on the structure of the eCos code
would be useful.
Robert Cragie, Design Engineer
_______________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
http://www.jennic.com Tel: +44 (0) 114 281 2655
_______________________________________________________________
--
To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml