public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Paul Koning <pkoning@equallogic.com>
To: drow@false.org
Cc: kevinb@redhat.com, gdb@sources.redhat.com
Subject: Re: enable_break() in solib-svr4.c
Date: Wed, 31 Aug 2005 21:40:00 -0000	[thread overview]
Message-ID: <17174.9177.644165.5664@gargle.gargle.HOWL> (raw)
In-Reply-To: <20050831211958.GA20405@nevyn.them.org>

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

 Daniel> On Wed, Aug 31, 2005 at 05:14:36PM -0400, Paul Koning wrote:
 >> No, it's the same issue, materializing in a second place.
 >> 
 >> The same conclusion applies as before: either NetBSD is wrong --
 >> it should use the bizarre and unintuitive meaning of "base
 >> address" that appears to be intended by the document you quoted --
 >> or NetBSD is right, "base address" means "the address where the
 >> thing ended up" (which is the intuitive definition) and GDB is
 >> wrong in several places.
 >> 
 >> The reason I'm picking on the meaning of "base address" is that
 >> "address" normally means a place, not a difference.  If people
 >> mean difference, the normal term used is "offset" or
 >> "displacement" or something like that.  So I find it hard to
 >> believe that "base address" is meant to be a difference between
 >> two addresses.

 Daniel> I didn't check the thread to see what the "quoted document"
 Daniel> was, but this is from the ELF gABI:

 Daniel> Because position-independent code uses relative addressing
 Daniel> between segments, the difference between virtual addresses in
 Daniel> memory must match the difference between virtual addresses in
 Daniel> the file. The difference between the virtual address of any
 Daniel> segment in memory and the corresponding virtual address in
 Daniel> the file is thus a single constant value for any one
 Daniel> executable or shared object in a given process. This
 Daniel> difference is the base address.

 Daniel> It really doesn't get any clearer than that.

Other than the fact that it uses the word "address" in a highly
unusual way, I agree, that's pretty clear.  Certainly much more so
than the text quoted in that earlier message.

Ok then, so the conclusion is that NetBSD (in 1.6.2 and before, at
least) violates this rule when it puts the load address, rather than
the difference between load and file addresses, into the "base
address".

Given that bug, I suppose it would make sense to put a target specific
workaround into gdb, i.e., "if the target is NetBSD (or "if the
target is NetBSD-MIPS"??) then 'base address' is not a difference but
just the load address".

That should not be hard.

     paul

  reply	other threads:[~2005-08-31 21:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-15 20:21 Paul Koning
2005-08-15 20:59 ` Mark Kettenis
2005-08-31 20:31 ` Kevin Buettner
2005-08-31 21:14   ` Paul Koning
2005-08-31 21:20     ` Daniel Jacobowitz
2005-08-31 21:40       ` Paul Koning [this message]
2005-08-31 21:19   ` Mark Kettenis

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=17174.9177.644165.5664@gargle.gargle.HOWL \
    --to=pkoning@equallogic.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=kevinb@redhat.com \
    /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).