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
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: deuling at de dot ibm dot com
- Cc: gdb-patches at sourceware dot org, uweigand at de dot ibm dot com
- Date: Wed, 7 Nov 2007 12:30:13 +0100 (CET)
- Subject: Re: [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c
- References: <47319D46.8080904@de.ibm.com>
> Date: Wed, 07 Nov 2007 12:11:02 +0100
> From: Markus Deuling <deuling@de.ibm.com>
>
> Hi,
>
> this patch adds gdbarch as a parameter to hppa_linux_register_addr.
>
> Tested with gdb_mbuild. Ok to commit ?
Actually, this is getting a bit silly. That gdbarch is only needed
for a sanaity check, and obviously the gdbarch_num_regs call can just
be replaced with an appropriate bounds check on the u_offsets array.
if (regno < 0 || regno >= ARRAY_SIZE(u_offsets))
should do the trick.
> ChangeLog:
>
> * hppa-linux-nat.c (hppa_linux_register_addr): Add gdbarch as parameter.
> Replace current_gdbarch by gdbarch.
> (fetch_register, store_register): Update caller of
> hppa_linux_register_addr.