This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: frameless functions
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Jan Hoogerbrugge <hoogerbrugge at hotmail dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 04 Mar 2003 12:58:14 -0500
- Subject: Re: frameless functions
- References: <F32es8JynCR34XtFT0D000255aa@hotmail.com>
Hi,
I porting gdb to a new target. The port is now in a stage where stack traces seem to work when code is compiled with a frame pointer. Now I am trying to get it working for code without a frame pointer. Could anyone tell me how to deal with frameless functions? Is there another port where I can learn from?
My compiler assigns the incoming sp to the fp. I guess this is what most compilers do.
In scan_prologue() I use fi->frame, which appears to correspond to the fp, to determine where registers are saved. What to do in the case of frameless functions? Should I assign something to fi->frame?
Should I define frameless_function_invocation()?
I'd ignore that method, it doesn't do much useful. You'll need to do at
least a minimal prologue analysis to determine the address of the
frameless frames `base'. You need to do this anyway to determine where
any pushed registers are.
As an alternative, your architecure might have debug info that lets you
locate the frame base.
I should also note that the frame code is being rewritten so when it
comes to integrate your architecture into GDB, you're going to encounter
some radical change.
Andrew