This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Debugging frameless code
- To: Nicolas dot Thery at Symbian dot com, gdb at sources dot redhat dot com
- Subject: Re: Debugging frameless code
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Thu, 28 Sep 2000 16:47:42 -0700
- References: <OF3EC7F5D9.4563E8D1-ON80256968.00501D1E@symbian.com>
On Sep 28, 3:43pm, Nicolas.Thery@Symbian.com wrote:
> GDB documentation states that gdb has limited ability to deal with code
> compiled without frame pointer.
>
> Does this limitation applies to every version of gdb and every kind of
> binary/debug format?
GDB does better on some targets than others. At the moment, I don't
think it depends too much upon the debug format. Most targets scan
the function prologue to learn about whether the function has a frame
pointer or not and also to learn where various registers are saved.
Some are better at handling functions that don't have frame pointers
than others.
> To be more precise, is it possible to dump stack backtrace for frameless
> code using a recent version of gdb and elf/dwarf2 (and gcc as the
> compiler)?
In some cases, yes. For example, I've been able to do this for
Linux/IA-64. (But it's also the case that as the optimization gets
more aggressive, this could fail.)
Which target in particular were you wondering about?
> I've been told that dwarf2 includes information that can help a debugger in
> such a case, but I don't know whether gcc actually emits these information
> and whether gdb is able to use them.
I'll let someone who is more familiar with DWARF2 than myself answer
this. I will note, however, that gdb's DWARF2 support is far from
complete and could certainly be made better.
Kevin