public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Ian Lance Taylor <ian@zembu.com>
Cc: alan@linuxcare.com.au, binutils@sourceware.cygnus.com,
	gdb-patches@sourceware.cygnus.com
Subject: Re: [rfc] For mips, sign-extended ecoff offsets
Date: Mon, 03 Jul 2000 23:47:00 -0000	[thread overview]
Message-ID: <39618810.8DD5D0F8@cygnus.com> (raw)
In-Reply-To: <20000623153232.1843.qmail@daffy.airs.com>

(I've been away for a week, sorry)

Ian Lance Taylor wrote:
> 
>    >  But the real fix is to use a
>    > 64-bit MIPS target.
> 
>    Kind of :-)  GDB can now be built to support (embedded only mind) the
>    debugging of a fairly arbitrary MIPS ABI on 64 bit MIPS targets.  For
>    instance, a single GDB executable can debug both ``gcc -mips2'' and
>    ``gcc ...'' executables running on a 64 bit vr5000.  It might even
>    eventually support that behavour under IRIX :-)
> 
>    Implementing this cleanly relies 32 bit MIPS addresses always being
>    correctly sign extended.  At present they are not and things are
>    suffering for it :-)
> 
> I don't understand that.  When gdb is debugging a 32 bit target, such
> as gcc -mips2, it should handle all target addresses as 32 bit values.
> Anything else would be a host/target confusion.  Sign extension or
> lack thereof should be irrelevant.

GDB has two things to contend with:

	o	the program - gcc -mips2 (32 bit) (ABI)

	o	the physical target - 32 or 64 bit (ISA)

When debugging a 32 bit program on what is a 64 bit physical target, GDB
could communicate using either 32 or 64 bit values/addresses.  GDB
started out by trying to follow the ABI and talk 32bit to 64 bit
physical targets.

It turns out this was a bad idea.  Instead, GDB should always talk
64bits to 64 bit physical targets.  This simplifies both the embedded
stub and GDBs internals.  In the case of GDB, the simplification comes
from replacing scrambled code trying to directly convert
symbolic-address <-> target-address with two clearly separate
translations - symbol<->canonical and cannonical<->target address.

> The only issue here is that, for historical reasons, some 64 bit
> targets use a 32 bit object file format.  If each 64 bit target used a
> 64 bit object file format, all would be well.

Yes, for the MIPS that is how things started.

Since then, however, things have evolved and now people are trying to do
things like build single GDB binaries that can debug (on IRIX) any of
n32, o32 and o64.

	enjoy,
		Andrew

      reply	other threads:[~2000-07-03 23:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-19  5:14 Andrew Cagney
2000-06-19  8:48 ` Alan Modra
2000-06-19 18:18   ` Andrew Cagney
2000-06-19 18:47     ` Ulf Carlsson
2000-06-19 18:57       ` Alan Modra
2000-06-19 19:16       ` Andrew Cagney
2000-06-19 20:08       ` Geoff Keating
2000-06-19 20:41         ` Ian Lance Taylor
2000-06-25 14:13           ` Ralf Baechle
     [not found]         ` <14670.59816.517716.492387@calypso.engr.sgi.com>
2000-06-19 21:30           ` Geoff Keating
2000-06-19 18:50     ` Alan Modra
2000-06-19 19:23       ` Andrew Cagney
2000-06-19 20:39       ` Ian Lance Taylor
2000-06-23  0:28         ` Andrew Cagney
2000-06-23  9:48           ` Ian Lance Taylor
2000-07-03 23:47             ` Andrew Cagney [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=39618810.8DD5D0F8@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=alan@linuxcare.com.au \
    --cc=binutils@sourceware.cygnus.com \
    --cc=gdb-patches@sourceware.cygnus.com \
    --cc=ian@zembu.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).