This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] [00/16] Get rid of current gdbarch
- From: Daniel Jacobowitz <drow at false dot org>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Markus Deuling <deuling at de dot ibm dot com>, GDB Patches <gdb-patches at sourceware dot org>, Eli Zaretskii <eliz at gnu dot org>, Joel Brobecker <brobecker at adacore dot com>, Jim Blandy <jimb at codesourcery dot com>, rearnsha at arm dot com, Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Date: Mon, 8 Oct 2007 09:35:25 -0400
- Subject: Re: [rfc] [00/16] Get rid of current gdbarch
- References: <4709E786.1070502@de.ibm.com> <200710081302.l98D2pKk010603@d12av02.megacenter.de.ibm.com>
On Mon, Oct 08, 2007 at 03:02:51PM +0200, Ulrich Weigand wrote:
> You should not call get_current_frame at this point; this might
> in fact fail as there is not necessarily a current frame selected
> at the point this callback is called.
>
> Instead, you should change the XXX_reg_to_regnum gdbarch entries
> from type "f" to "m"; then the functions will be automatically
> provided with a gdbarch parameter. (This should be a separate
> patch from the remaining trivial current_gdbarch replacements.)
/* This will hopefully provoke a warning. */
- return gdbarch_num_regs (current_gdbarch)
- + gdbarch_num_pseudo_regs (current_gdbarch);
+ return gdbarch_num_regs (gdbarch)
+ + gdbarch_num_pseudo_regs (gdbarch);
That's the only thing it's used for. Does it provoke a warning? If
not, maybe -1 or something similar should...
--
Daniel Jacobowitz
CodeSourcery