public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: David Taylor <dtaylor@emc.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: RFA bug fix -- x86-64 stabs and deprecated fp register
Date: Wed, 03 Dec 2014 03:43:00 -0000	[thread overview]
Message-ID: <CADPb22Q8EL=ep+nEj=KpBgPgcs3XHtaDo_dbc3KH7+GH6LFcng@mail.gmail.com> (raw)
In-Reply-To: <3508.1416603484@usendtaylorx2l>

On Fri, Nov 21, 2014 at 12:58 PM, David Taylor <dtaylor@emc.com> 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.
>
> diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
> index e69da01..5a68c33 100644
> --- a/gdb/amd64-tdep.c
> +++ b/gdb/amd64-tdep.c
> @@ -3006,6 +3006,8 @@ amd64_init_abi (struct gdbarch_info info, struct gdbarch *
> gdbarch)
>    set_gdbarch_ps_regnum (gdbarch, AMD64_EFLAGS_REGNUM); /* %eflags */
>    set_gdbarch_fp0_regnum (gdbarch, AMD64_ST0_REGNUM); /* %st(0) */
>
> +  set_gdbarch_deprecated_fp_regnum (gdbarch, AMD64_RBP_REGNUM); /* %rbp */
> +
>    /* The "default" register numbering scheme for AMD64 is referred to
>       as the "DWARF Register Number Mapping" in the System V psABI.
>       The preferred debugging format for all known AMD64 targets is

Hi.
I haven't dug too deep to understand whether this is a good fix or not,
but I have a request.
Given the discussion, I think it's reasonable to assume a future
reader of the code will ask "Why is this code here?"
One of my pet peeves is having to spend too much time
answering that question, and while I would much rather have
such questions answered in the code, I also don't want to have
to read more than a few sentences (in general - certainly there
are cases where a paragraph or two in the code can be
invaluable).  At any rate ...
I'll let you decide whether to add something to the code or
to the commit message (or both), but at a minimum please add
a full description to the commit message that explains things.

Thanks!

      parent reply	other threads:[~2014-12-03  3:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 20:58 David Taylor
2014-11-30 15:20 ` Joel Brobecker
2014-11-30 18:59   ` Mark Kettenis
2014-12-01 16:42     ` David Taylor
2014-12-03  3:19       ` Joel Brobecker
2014-12-01 16:30   ` David Taylor
2014-12-03  3:50     ` Joel Brobecker
2014-12-03 17:31       ` Doug Evans
2014-12-04  3:20         ` Joel Brobecker
2014-12-05 13:38     ` Mark Kettenis
2014-12-03  3:43 ` Doug Evans [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADPb22Q8EL=ep+nEj=KpBgPgcs3XHtaDo_dbc3KH7+GH6LFcng@mail.gmail.com' \
    --to=dje@google.com \
    --cc=dtaylor@emc.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).