This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

avr and frame unwinding


Hi,

I've pretty much hit a wall on this, so I will have to ask for help
now.

The attached is what I have so far in my attempt to frame-ify
avr-tdep.c. As it stands, things kinda work. I can 'step' around a
program fine.

Things go wrong as soon as I try to 'next' over a function call, gdb
goes into an infinite loop. If I 'step' down into a function called
from main(), a backtrace never gets me back to main. Here's a dump of
the backtrace output (I'll forego the infinite loop output to save
some bandwidth 8-):

func1 () at tst.c:23
23          struct cc var = {0};        /* This uses memset()! */
(gdb) bt
#0  func1 () at tst.c:23
{ get_prev_frame (this_frame=0) { frame_id_p
(l={stack=0x8010f9,code=0xd0}) -> 1 }
{ frame_register_unwind (frame=0,regnum="PC",...) {
frame_register_unwind (frame=-1,regnum="PC",...) -> *optimizedp=0
*lvalp=2 *addrp=0x23 *bufferp=[fffffff0000000] }
-> *optimizedp=0 *lvalp=2 *addrp=0x23 *bufferp=[fffffff0000000] }
{ frame_pc_unwind (this_frame=0) -> 0xf0 }
->
{level=1,type=UNKNOWN_FRAME,unwind=<unknown>,pc=0xf0,id=<unknown>,func=<unknown>}
}
#1  0x000000f0 in func1 () at tst.c:22
{ get_prev_frame (this_frame=1) { get_frame_id (fi=1) {
frame_func_unwind (fi=0) -> 0xd0 }
Sending packet: $md0,27#96...Ack
Packet received:
cf92df92ef92ff920f931f93cf93df93cdb7deb726970fb6f894debf0fbecdbf86e0fe01319611
Sending packet: $mf7,11#98...Ack
Packet received: 928a95e9f719821a82ed80fe80cc24dd24
{ frame_register_unwind (frame=0,regnum="r28",...) Sending packet:
$m801100,1#f4...Ack
Packet received: 00
-> *optimizedp=0 *lvalp=1 *addrp=0x801100 *bufferp=[00] }
{ frame_register_unwind (frame=0,regnum="r29",...) Sending packet:
$m801101,1#f5...Ack
Packet received: 00
-> *optimizedp=0 *lvalp=1 *addrp=0x801101 *bufferp=[00] }
{ frame_id_eq
(l={stack=0x8010f9,code=0xd0},r={stack=0x80000e,code=0xd0}) -> 0 }
-> {stack=0x80000e,code=0xd0} }
{ frame_id_p (l={stack=0x80000e,code=0xd0}) -> 1 }
{ frame_id_inner
(l={stack=0x80000e,code=0xd0},r={stack=0x8010f9,code=0xd0}) -> 1 }
This frame inner-to next frame (corrupt stack?)
(gdb)


I'm pretty confused as to how frames are getting chained up and
unwound. I suspose that I'm not thinking about the the SP in the
proper manner in relation to the frames.

Could some kind soul lend me some insight?

Thanks.

Ted Roth

Attachment: avr-tdep.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]