This is the mail archive of the gdb@sources.redhat.com 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 23-Feb-2001, Andrew Cagney wrote:

>	o	The frame have an architecture
>		attached to it.

Yes, this seems like the right thing to do.

>		As an intermediate hack, current
>		architecture and current frame would
>		remain as globals.

So eventually, current_gdbarch and selected_frame will be deprecated in
favor of passing gdbarch and/or frame pointers as parameters?

I wonder if that's really beneficial.  Global variables should be used
sparingly, but they're appropriate for values shared across large expanses
of code, as current_gdbarch and selected_frame are.

Keeping those values in global variables could make the code more
maintainable rather than less.  We'd need to add explicit context switches
at frame boundary crossings, but that seems lees onerous to me than adding
extra parameters to hundreds (thousands?) of function calls.

Nick


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