This is the mail archive of the
mailing list for the GDB project.
Re: [multi-arch] The frame as the global parameter (long, important)
- To: ac131313 at cygnus dot com
- Subject: Re: [multi-arch] The frame as the global parameter (long, important)
- From: Nick Duffek <nsd at redhat dot com>
- Date: Mon, 26 Feb 2001 16:20:55 -0500
- CC: gdb at sources dot redhat dot com
- References: <3A970102.68681EB2@cygnus.com>
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.