Re: [rfc] [00/16] Get rid of current gdbarch

Daniel Jacobowitz
2007-10-08T13:35:34Z

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