This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] [02/05] Get rid of current_gdbarch in hppa-linux-nat.c


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]