Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>,
	GDB Discussion <gdb@sources.redhat.com>
Subject: Re: [multi-arch] The frame as the global parameter (long, important)
Date: Mon, 26 Feb 2001 13:44:00 -0000	[thread overview]
Message-ID: <1010226214342.ZM12978@ocotillo.lan> (raw)
In-Reply-To: <3A970102.68681EB2@cygnus.com>

On Feb 23,  7:32pm, Andrew Cagney wrote:

[Big picture snipped]
> Given all this, I'd like to propose the following structural changes to
> GDB.
> 
> 	o	The frame have an architecture
> 		attached to it.
> 
> 		As an intermediate hack, current
> 		architecture and current frame would
> 		remain as globals.
> 
> 	o	All the functions that apply to
> 		the frame be parameterized with a
> 		frame argument and modified to
> 		use the frame's architecture.
> 
> 	o	(Per previous e-mail)
> 		The frame and its registers be more
> 		clearly separated from the target
> 		(in particular the regcache).
> 
> 		Most calls that go directly to the
> 		regcache will instead go via the
> 		current frame.
> 
> 		A consequence of this is that the
> 		current need for the RAW / PSEUDO
> 		/ NATURAL register mess will be
> 		eliminated.  Yessss!
> 
> While looking simple, these changes are certainly everything but.  Every
> frame / regcache / memcache access will need to be examined / modified. 
> Fortunately, most of these uses can be examined independently so the
> work can be carried out incrementally.
> 
> Clearly this change, on its own, won't be sufficient to make GDB
> multi-arch.  I would argue, however, that like the initial multi-arch
> work, it is a clear step in the right direction.
> 
> With that in mind, I'm looking for comments, questions and suggestions.  

Andrew,

The big picture that you painted certainly looks reasonable.  But even
if it didn't, I think the structural changes that your propose above
make sense even when considered on a much smaller scale...

It makes sense to associate an architecture with a frame so that we
can cleanly implement support for targets with mixed architectures
like ARM/THUMB or IA-64/IA-32.

Also, from a software engineering standpoint, I think it makes sense
to eliminate as many of the globals as possible and pass parameters
instead.  Any time one or more of the parameters to a function are
passed implicitly via a global, you're just asking for trouble later
on.

Kevin


  parent reply	other threads:[~2001-02-26 13:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-23 16:34 Andrew Cagney
2001-02-26 13:12 ` Nick Duffek
2001-02-26 13:53   ` Kevin Buettner
2001-02-26 15:27     ` Nick Duffek
2001-02-26 15:55       ` Kevin Buettner
2001-02-26 14:42   ` Andrew Cagney
2001-02-26 13:44 ` Kevin Buettner [this message]
     [not found] <983058218.3463.ezmlm@sources.redhat.com>
2001-02-26 10:17 ` Jim Ingham
2001-02-26 13:16   ` Nick Duffek
2001-02-26 13:27     ` Jim Ingham
2001-02-26 13:28     ` Per Bothner
2001-02-26 13:50   ` Andrew Cagney
2001-02-26 14:52     ` Jim Ingham
2001-02-26 16:28       ` Andrew Cagney
2001-02-26 18:14         ` Jim Ingham

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=1010226214342.ZM12978@ocotillo.lan \
    --to=kevinb@cygnus.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