Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "John David Anglin" <dave@hiauly1.hia.nrc.ca>
To: mark.kettenis@xs4all.nl (Mark Kettenis)
Cc: randolph@tausq.org, gdb@sources.redhat.com, brobecker@adacore.com
Subject: Re: Register numbers on hppa64
Date: Sat, 26 Nov 2005 17:20:00 -0000	[thread overview]
Message-ID: <200511261713.jAQHDcTw024157@hiauly1.hia.nrc.ca> (raw)
In-Reply-To: <200511261518.jAQFIN2K022588@elgar.sibelius.xs4all.nl> from "Mark Kettenis" at Nov 26, 2005 04:18:23 pm

> It's not too bad ;-).
> 
> > Apparently we now have at least three different register numbering 
> > schemes for hppa64:
> > 
> > 1) gcc "dbx":
> > 0-31: r0-r31
> > 72-135: fr0-fr31 (odd numbers are not used)
> > 60: sar
> 
> gcc/config/pa/pa64-regs.h says:
> 
> /* How to renumber registers for dbx and gdb.
> 
>    Registers 0  - 31 remain unchanged.
> 
>    Registers 32 - 59 are mapped to 72, 74, 76 ...
> 
>    Register 60 is mapped to 32.  */
> 
> So it seems that the last line of your list should be:
> 
> 32: sar

Also, gcc register 32 is fr4, so the floating-point registers match
the gdb numbers.  Odd "floating-point" numbers aren't used.

> > 3) gdb
> > 0-31: r0-r31
> > 32-63: sar, pcoqh, pcsqh, other "special" registers
> > 64-95: fr0-fr31
> 
> This is GDB's *internal* register mapping.  On some targets we've been
> careful and made that internal register mapping match the one used by
> the "standard" compiler/debugger on that target, for most targets this
> is not the case.
> 
> > 4) HP compilers
> > ???
> 
> I'm not even sure what debug format HP's 64-bit compilers use.  The
> fact that the dbx mapping is a bit weird, suggests that there has been
> a system that used stabs with that register mapping once.  Not sure if
> that was HP-UX or the old BSD variant that ran on PA-RISC systems.

I don't think stabs has been used with GCC on hppa64.

> Since it's GDB's internal numbering it's perfectly well possible that
> the numbering scheme isn't used by any debug format at all.  I think
> it's mostly dictated by the layout of "struct save_state" from HP-UX.
> Could be that this is the numbering scheme used by HP though.

That's also my impression.  However, since PA 2.0, the layout of
"struct save_state" is more complicated.  In the 32-bit case,
access depends on whether or not UseWideRegs (ssp) is true or not.
It's not entirely clear how one would derive an unique numbering.

Really, the issue seems to be converting the dbx and frame numbers
to gdb's internal numbering.  This is a nop for the dbx numbers but
not for the frame numbers.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)


  parent reply	other threads:[~2005-11-26 17:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200511260253.jAQ2rP7Z021130@hiauly1.hia.nrc.ca>
2005-11-26  9:23 ` Randolph Chung
2005-11-26 15:54   ` Mark Kettenis
2005-11-26 16:52     ` Randolph Chung
2005-11-26 17:32       ` Mark Kettenis
2005-11-26 18:50         ` John David Anglin
2005-11-27 16:30         ` Randolph Chung
2005-11-26 17:34       ` John David Anglin
2005-11-26 17:20     ` John David Anglin [this message]
2005-11-26 17:13   ` John David Anglin
2005-11-26 17:52     ` Mark Kettenis
2005-11-26 18:00       ` John David Anglin
2005-11-26 18:31         ` Mark Kettenis
2005-11-27  4:30           ` John David Anglin
2005-11-27 15:10             ` Randolph Chung
2005-11-27 16:52               ` John David Anglin
2005-11-27 17:42               ` 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=200511261713.jAQHDcTw024157@hiauly1.hia.nrc.ca \
    --to=dave@hiauly1.hia.nrc.ca \
    --cc=brobecker@adacore.com \
    --cc=gdb@sources.redhat.com \
    --cc=mark.kettenis@xs4all.nl \
    --cc=randolph@tausq.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