Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: eliz@gnu.org
Cc: gdb-patches@sourceware.org
Subject: Re: [10/19] record_line
Date: Mon, 08 Jun 2009 14:53:00 -0000	[thread overview]
Message-ID: <200906081453.n58ErNWT012241@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <E1MCkUt-0000zi-Ml@fencepost.gnu.org> from "Eli Zaretskii" at Jun 05, 2009 09:14:59 PM

Eli Zaretskii wrote:
> > Date: Fri, 5 Jun 2009 23:18:16 +0200 (CEST)
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > 
> > the record_line routine calls gdbarch_addr_bits_remove on the PC it is
> > passed.  As there is no appropriate objfile at hand in this routine,
> > the following patch moves this operation up into the callers of record_line,
> > which will use the objfile architecture of the file they are processing.
> 
> Maybe I'm missing something, but isn't this rather inelegant?  We are
> moving some detail that is private to record_line into its callers,
> just because record_line doesn't know the architecture nor the objfile
> to get the architecture from?  Why not simply pass the architecture or
> the objfile to record_line instead?

Well, I guess I didn't really express this in the patch email, but it seemed
to me that calling gdbarch_addr_bits_remove should't really be a private
detail of record_line.   IMO this routine should simply take an actual PC
as input, as its comment states -- whatever hacks are required to compute
an actual PC value from information found in the object file should be done
in the symbol readers themselves (this might actually depend on the format).

For the purposes of this patch series, passing an objfile in to record_line
would work for me as well.  It just didn't seem quite the right thing ..

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


      reply	other threads:[~2009-06-08 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 21:18 Ulrich Weigand
2009-06-06  1:15 ` Eli Zaretskii
2009-06-08 14:53   ` Ulrich Weigand [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=200906081453.n58ErNWT012241@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=eliz@gnu.org \
    --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