This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [multi-arch] The frame as the global parameter (long, important)

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.  


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]