This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c
On Wed, Nov 07, 2007 at 03:50:33PM +0100, Markus Deuling wrote:
> What this patch does is transform
>
> if ((unsigned) regno >= gdbarch_num_regs (current_gdbarch))
> error (_("Invalid register number %d."), regno);
>
>
> into
>
> if ((unsigned) regno >= gdbarch_num_regs (gdbarch))
> error (_("Invalid register number %d."), regno);
>
>
> The gdbarch comes from regcache in {fetch,store}_register. Why is that wrong ?
Again, it is not necessary to add a gdbarch parameter here. Why are
we checking regno? We're checking it because we're about to use it to
index into the u_offsets array, and we don't want to go out of bounds.
--
Daniel Jacobowitz
CodeSourcery