This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA bug fix -- x86-64 stabs and deprecated fp register
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: brobecker at adacore dot com
- Cc: dtaylor at emc dot com, gdb-patches at sourceware dot org
- Date: Sun, 30 Nov 2014 19:59:15 +0100 (CET)
- Subject: Re: RFA bug fix -- x86-64 stabs and deprecated fp register
- Authentication-results: sourceware.org; auth=none
- References: <3508 dot 1416603484 at usendtaylorx2l> <20141130152036 dot GC4882 at adacore dot com>
> Date: Sun, 30 Nov 2014 19:20:36 +0400
> From: Joel Brobecker <brobecker@adacore.com>
>
> David,
>
> On Fri, Nov 21, 2014 at 03:58:04PM -0500, David Taylor wrote:
> > Sometimes when using STABS on x86-64 GNU/Linux, GDB does not know which
> > register to use for the frame pointer and as a result offsets from the
> > frame pointer are treated as absolute addresses rather than as
> > offsets...
> >
> > This patch provides a default for when the debug information doesn't
> > specify which register to use.
> >
> > We have seen this problem when debugging problems with a previous
> > release of our software (I believe it was built with GCC 4.5.x, if that
> > matters).
> >
> > There were no regressions on x86-64 GNU/Linux.
> >
> > 2014-11-21 David Taylor <dtaylor@emc.com>
> >
> > * amd64-tdep.c (amd64_init_abi): Set default frame pointer.
>
> I don't think your patch is correct, as it is going to affect
> the outcome of...
>
> (gdb) print $fp
>
> ... for frameless functions compiled with DWARF2. See
> std-regs.c:value_of_builtin_frame_fp_reg.
>
> If we were to apply your patch, it would unconditionally print
> the contents of the %rbp register as the result, which is not
> what we've been printing so far.
>
> I wish I could suggest another approach but I haven't had to touch
> stabs support in several years, now. If you provided a bit more details
> as to what actually happened in the debugger and where, I might be
> able to help you better.
But any effort is much better spent on switching to DWARF2. STABS
support ws already considered obsolete when AMD64 support was added to
GDB more than a decade ago.