Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
Cc: gdb@sources.redhat.com
Subject: Re: parcelling up struct gdbarch
Date: Wed, 18 Jul 2001 22:53:00 -0000	[thread overview]
Message-ID: <3B5675BA.4010403@cygnus.com> (raw)
In-Reply-To: <20010718132140.A2937@nevyn.them.org>

> I'm looking right now at rs6000-tdep.c.  When we need a gdbarch for a
> PPC binary, we call rs6000_gdbarch_init, which builds the architecture. 
> What registers are available depends on what registers the target
> architecture actually has.


Careful.  That code is now interpreted in a different light.

GDBarch sets up a mapping between an user-visible or cooked registers 
and the raw register cache.  Which registers are ``available'' depends 
on several things:

	o	the cooked registers visible to
		the user

	o	the raw registers stored in the register cache

	o	the register values supplied by the
		target (or gdbserver).


> At the same time, what registers gdbserver can provide are strictly
> limited - in the same way that what registers infptrace can provide are
> also strictly limited.  In this case, to the bulk of the GPRs, the
> FPRs, and eventually (if no one beats me to it, I'll be adding kernel
> support for...) the Altivec registers if we're on a processor that has
> them.
> 
> No matter what architecture is set, if we're debugging userland Linux
> applications, they see the same things.  Linux userland is, for all
> intents and purposes that I can see, a gdbarch itself - two if you
> break it up w.r.t. whether Altivec is available or not.  It determines
> calling conventions and available registers.  This could, of course,
> change.  It's not unreasonable to hypothesize ptrace returning
> different registers depending on what processor is actually in use.


Don't forget you need to bump the syscall number as part of that new 
interface.


> Somehow, we need to get GDB and gdbserver to agree on what registers
> exist and what will be sent in a register info packet.  This will, as
> far as I'm concerned, require some sort of protocol addition.  As I see
> it:
>   - gdbserver is the authority on what registers are available.
>   - gdb must be prepared to give meaning to all of those registers
>     (even if "meaning" == "none").
> We can tie it to the gdbarch, but that seems like a bad idea,
> especially given the flexibility with which gdbarches seem to be
> generated.


Either that or a formal specification of what a G packet should contain 
and then stick too it.


> So, in my N'th consecutive suggestion: is it reasonable to assign a
> name to each register packet format, document them by name, and allow
> GDB to send a query for the format which gdbserver will use?


Hmm


> (for what it's worth, which is probably not much, I like this solution
> for this particular problem better than anything else I've come up with
> or heard so far, and it sounds like we were both going in this general
> direction.)


I think there are two paths.  One has a formalized G packet layout the 
other has  total flexability.  If GDB is going to try to accept multiple 
different packet layouts then it will surely miss one.  In that case, 
why not assume it will miss one and give the user the flexability to 
specify a custom packet spec.  The set of named packets could just be 
pre-defined specifications.  A set of hard-wired packet specs would be a 
compromise.

	Andrew


  reply	other threads:[~2001-07-18 22:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-13  0:16 Daniel Jacobowitz
2001-07-13 12:35 ` Andrew Cagney
2001-07-13 14:53   ` Daniel Jacobowitz
2001-07-14  8:33     ` Andrew Cagney
2001-07-16 11:25       ` Daniel Jacobowitz
2001-07-16 11:27         ` H . J . Lu
2001-07-16 12:04         ` Andrew Cagney
2001-07-16 12:34           ` J.T. Conklin
2001-07-16 15:30             ` Andrew Cagney
2001-07-16 15:40               ` Daniel Jacobowitz
2001-07-16 17:24                 ` gdbserver (was Re: parcelling up struct gdbarch) Fabrice Gautier
2001-07-16 21:17                   ` Daniel Jacobowitz
2001-07-16 22:22                     ` Fabrice Gautier
2001-07-16 22:28                       ` Daniel Jacobowitz
2001-07-17 10:00                   ` Andrew Cagney
2001-07-17 10:11                     ` Daniel Jacobowitz
2001-07-17 11:10                       ` Andrew Cagney
2001-07-17 11:21                         ` Daniel Jacobowitz
2001-07-17 11:46                           ` Andrew Cagney
2001-07-17 10:36                   ` Quality Quorum
2001-07-16 13:05           ` parcelling up struct gdbarch Daniel Jacobowitz
2001-07-16 15:15             ` Andrew Cagney
2001-07-16 15:49               ` Daniel Jacobowitz
2001-07-17 10:46                 ` Andrew Cagney
2001-07-17 11:03                   ` Daniel Jacobowitz
2001-07-17 11:37                     ` Andrew Cagney
2001-07-18 13:21                       ` Daniel Jacobowitz
2001-07-18 22:53                         ` Andrew Cagney [this message]
2001-07-18 23:22                           ` Daniel Jacobowitz
2001-07-19  0:23                             ` Daniel Jacobowitz
2001-07-19  7:51                               ` Andrew Cagney
2001-07-19  7:44                             ` Andrew Cagney
2001-07-18  8:09 ` Andrew Cagney

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=3B5675BA.4010403@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=dmj+@andrew.cmu.edu \
    --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