* FP vs SP
@ 2003-09-05 22:44 Jafa
2003-09-05 23:03 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Jafa @ 2003-09-05 22:44 UTC (permalink / raw)
To: gdb
Hi all,
I recently updated the ip2k gdb port to use the new frame handling support
in gdb.
It can reliably do a stack backtrace and can reliably step-over etc.
The one problem is that all local variables show up as garbage.
I have looked into this and it seams that GDB is using the frame-pointer
(aka SP as at the entry point of the function) as the reference point for
the stack offset of the local variables. Is this correct or have I screwed
up something in my frame handling code?
Looking at the stabs information coming out of gcc (2.97) the offsets are
all specified as being relative to the nominal SP (stack pointer at the
start of any c-line)... is this correct or should it be giving FP relative
addresses?
I would appreciate any advice.
Thanks
Nick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FP vs SP
2003-09-05 22:44 FP vs SP Jafa
@ 2003-09-05 23:03 ` Daniel Jacobowitz
2003-09-05 23:08 ` Jafa
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-09-05 23:03 UTC (permalink / raw)
To: Jafa; +Cc: gdb
On Fri, Sep 05, 2003 at 03:44:13PM -0700, Jafa wrote:
> Hi all,
>
> I recently updated the ip2k gdb port to use the new frame handling support
> in gdb.
>
> It can reliably do a stack backtrace and can reliably step-over etc.
>
> The one problem is that all local variables show up as garbage.
>
> I have looked into this and it seams that GDB is using the frame-pointer
> (aka SP as at the entry point of the function) as the reference point for
> the stack offset of the local variables. Is this correct or have I screwed
> up something in my frame handling code?
>
> Looking at the stabs information coming out of gcc (2.97) the offsets are
> all specified as being relative to the nominal SP (stack pointer at the
> start of any c-line)... is this correct or should it be giving FP relative
> addresses?
You can control what GDB does here by defining a frame base method -
see frame-base.h. Probably you've changed the meaning of
get_frame_locals_address ().
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FP vs SP
2003-09-05 23:03 ` Daniel Jacobowitz
@ 2003-09-05 23:08 ` Jafa
0 siblings, 0 replies; 3+ messages in thread
From: Jafa @ 2003-09-05 23:08 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
Ah, I see it now - thanks!
Nick
----- Original Message -----
From: "Daniel Jacobowitz" <drow@mvista.com>
To: "Jafa" <jafa@silicondust.com>
Cc: <gdb@sources.redhat.com>
Sent: Friday, September 05, 2003 4:03 PM
Subject: Re: FP vs SP
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> On Fri, Sep 05, 2003 at 03:44:13PM -0700, Jafa wrote:
> > Hi all,
> >
> > I recently updated the ip2k gdb port to use the new frame handling
support
> > in gdb.
> >
> > It can reliably do a stack backtrace and can reliably step-over etc.
> >
> > The one problem is that all local variables show up as garbage.
> >
> > I have looked into this and it seams that GDB is using the frame-pointer
> > (aka SP as at the entry point of the function) as the reference point
for
> > the stack offset of the local variables. Is this correct or have I
screwed
> > up something in my frame handling code?
> >
> > Looking at the stabs information coming out of gcc (2.97) the offsets
are
> > all specified as being relative to the nominal SP (stack pointer at the
> > start of any c-line)... is this correct or should it be giving FP
relative
> > addresses?
>
> You can control what GDB does here by defining a frame base method -
> see frame-base.h. Probably you've changed the meaning of
> get_frame_locals_address ().
>
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-09-05 23:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-05 22:44 FP vs SP Jafa
2003-09-05 23:03 ` Daniel Jacobowitz
2003-09-05 23:08 ` Jafa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox