Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Richard.Earnshaw@arm.com, gdb@sources.redhat.com
Subject: Re: ARM and virtual/raw registers
Date: Sun, 12 May 2002 07:20:00 -0000	[thread overview]
Message-ID: <200205121419.PAA29377@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Sat, 11 May 2002 17:52:41 EDT." <3CDD92A9.70401@cygnus.com>


> The remote target is more than technically broken.
> 

I'm glad we agree on something then ;-)

> GDB is a slave to the remote protocol.  The remote protocol is what 
> decides the layout of the raw register cache and that cache layout 
> depends on what ever the remote target and GDB once, long ago, 
> co-conspired.  You can't touch the raw registers without breaking GDB's 
> ability to debug a remote target.  The MIPS, for instance, has more 
> remote protocol formats than I've had hot dinners.  Every different MIPS 
> configuration has a different, hard wired, remote protocol register buffer.
> 
> BTW, the reason I mention i387-tdep.c is that I think it is an example 
> of where target side manipulation can go wrong.  The i387-tdep code 
> doesn't just massage values, it instead completly re-orders the register 
> cache so that it contains the registers in i387 stack order.  That, in 
> turn, lead to all sorts of bugs when trying to save/restore the i387 
> registers.  If this were re-implemented today, I think it the register 
> buffer would be would left in i387 save order, instead using 
> register_{read,write} (they were not available at the time).

Having either the debug-info register numbers or a single target impose an 
order on the regcache is broken.  Consider the case where we have two 
target interfaces that need to mandate different orderings; clearly one of 
them must fail.  Similarly, having the debug-info mandate an ordering is 
equally broken -- consider two ABIs which use different numbering in the 
debug info.  Clearly, the only way to solve this is to have mapping 
layers, at least in concept, at each interface.  Then the tdep code is 
free to select any ordering it likes in the cache; typically an ordering 
that will lead to greatest efficiency.

A colleague of mine once commented: "There's very few software problems 
that can't be solved with an extra layer of indirection."  This is clearly 
one that can...

> I think, under your model, this would be flaged as a no-no - there being 
> no technical reason for laying the registers out in a way other than 
> according to i387 save order.

See the WIP code I posted just now.

R.


  reply	other threads:[~2002-05-12 14:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-09  7:31 Richard Earnshaw
2002-05-09  9:45 ` Andrew Cagney
2002-05-09 10:01   ` Richard Earnshaw
2002-05-09 11:52     ` Andrew Cagney
2002-05-10  3:45       ` Richard Earnshaw
2002-05-10  7:48         ` Andrew Cagney
2002-05-10 12:07           ` Andrew Cagney
2002-05-11  7:05             ` Richard Earnshaw
2002-05-11 14:52               ` Andrew Cagney
2002-05-12  7:20                 ` Richard Earnshaw [this message]
2002-05-12  8:25                   ` Andrew Cagney
2002-05-12  8:30                     ` Richard Earnshaw
2002-05-12  8:51                       ` Andrew Cagney
2002-05-10  9:29       ` Richard Earnshaw
2002-05-10 11:42         ` Andrew Cagney
2002-05-11  6:16           ` Richard Earnshaw
2002-05-11 11:41           ` Richard Earnshaw
2002-05-11 13:36             ` Andrew Cagney
2002-05-12  7:11               ` Richard Earnshaw
2002-05-12  7:40                 ` Richard Earnshaw
2002-05-12  9:03                   ` Andrew Cagney
2002-05-12 11:31                     ` Andrew Cagney
2002-05-12  8:07                 ` Andrew Cagney
2002-05-12  8:25                   ` Richard Earnshaw
2002-05-12  8:41                     ` Andrew Cagney
2002-05-13  5:35                   ` Richard Earnshaw
2002-05-13  6:13                     ` Andrew Cagney
2002-05-13  6:18                       ` Richard Earnshaw
2002-05-09 10:08 ` Andrew Cagney
2002-05-09 10:36   ` Richard Earnshaw

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=200205121419.PAA29377@cam-mail2.cambridge.arm.com \
    --to=rearnsha@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb@sources.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