Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: Do solib address arithmetic with appropriate truncation
Date: Tue, 05 Feb 2002 15:30:00 -0000	[thread overview]
Message-ID: <npy9i7pkta.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <1020203180114.ZM12779@localhost.localdomain>


Kevin Buettner <kevinb@redhat.com> writes:

> On Feb 2,  8:31pm, Jim Blandy wrote:
> 
> > Sat Feb  2 17:03:26 2002  Jim Blandy  <jimb@seadog.cygnus.com>
> > 
> > 	* solib-svr4.c (svr4_truncate_ptr): New function.
> > 	(svr4_relocate_section_addresses): Do the address arithmetic with
> > 	the appropriate truncation for target addresses, even when
> > 	CORE_ADDR is larger than a target address.
> 
> I think this is a satisfactory short term (or even mid term) solution.
> I think the long term solution will be to introduce a method for adding
> offsets to CORE_ADDRs.  See
> 
>     http://sources.redhat.com/ml/gdb/2001-10/msg00036.html
> 
> I think it's okay to commit this patch, but I'd appreciate it if you'd
> add a comment indicating that svr4_truncate_ptr() should be removed
> when methods for adding displacements to CORE_ADDRs are introduced.

Okay, I've committed it with the following comment:

/* Clear any bits of ADDR that wouldn't fit in a target-format
   data pointer.  "Data pointer" here refers to whatever sort of
   address the dynamic linker uses to manage its sections.  At the
   moment, we don't support shared libraries on any processors where
   code and data pointers are different sizes.

   This isn't really the right solution.  What we really need here is
   a way to do arithmetic on CORE_ADDR values that respects the
   natural pointer/address correspondence.  (For example, on the MIPS,
   converting a 32-bit pointer to a 64-bit CORE_ADDR requires you to
   sign-extend the value.  There, simply truncating the bits above
   TARGET_PTR_BIT, as we do below, is no good.)  This should probably
   be a new gdbarch method or something.  */


      reply	other threads:[~2002-02-05 23:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-02 17:29 Jim Blandy
2002-02-03 10:24 ` Andrew Cagney
2002-02-04  8:15   ` Kevin Buettner
2002-02-04  9:01     ` Andrew Cagney
2002-02-05 16:07       ` Jim Blandy
2002-02-05 16:39         ` Andrew Cagney
2002-02-06 11:27           ` Jim Blandy
2002-02-06 11:41             ` Andrew Cagney
2002-02-06 14:12             ` Daniel Jacobowitz
2002-02-03 23:09 ` Kevin Buettner
2002-02-05 15:30   ` Jim Blandy [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=npy9i7pkta.fsf@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.com \
    --cc=gdb-patches@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