simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] probably simulavr/gdb bug


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] probably simulavr/gdb bug
Date: Wed, 30 Jan 2002 16:31:39 -0700 (MST)

On Wed, 30 Jan 2002, ken restivo wrote:

:)well, i've isolated this down to a small test program. it looks like
:)the execution bug was mine, but the gdb problem looks like it's in
:)simulavr/gdbserver.c somewhere.

:)basically, if you step through it in avr-gdb, the call to calledFunc
:)looks right, but once you step into calledFunc, then reports garbage
:)values for the passed-in parameters. the registers themselves look
:)correct in disp.
:)

Here's what I'm seeing in gdb:

Breakpoint 1, main (argc=0, argv=0x0) at bug.c:52
(gdb) n
(gdb) p idler
$1 = {void ()} 0x56 <idler>
(gdb) s
calledFunc (thr=0x63, pri=0, funk=0x2b <.__c_startup__+17>, stackSize=0)
    at bug.c:42
(gdb) p funk
$2 = (void (*)()) 0x2b <.__c_startup__+17>
(gdb)


It looks like gdb is once again confused about the difference between 
program space and data space. Argh!

The idler() function is at flash addr 0x2b but gdb thinks it is at 0x56
(0x2b * 2). Gdb reports that funk is 0x2b (which is correct), but isn't
translating it as a function pointer correctly. The 0x2b doesn't match up
with what's in the elf file or the .lst file since gdb thinks all
addresses are byte aligned.

This will make things very difficult for debugging but I think that the 
program should run correctly. I will have to dig into gdb again and see 
if I can come up with something. My gut feeling is that this will not be a 
trivial fix.

Ted





reply via email to

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