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: [PATCH][SH] Implement core-file support for sh-linux


> 2009-10-12  Andrew Stubbs  <ams@codesourcery.com>
> 
> 	* configure.tgt (sh*-*-linux*): Add corelow.o to gdb_target_obs.
> 	* sh-linux-tdep.c: Include gdb_assert.h, gdb_string.h, regcache.h,
> 	regset.h and sh-tdep.h.
> 	(struct sh_linux_pt_regs, struct sh_linux_user_fpu_struct): New types.
> 	(sh_linux_supply_gregset, sh_linux_collect_gregset): New functions.
> 	(sh_linux_supply_fpregset, sh_linux_collect_fpregset): New functions.
> 	(sh_linux_gregset, sh_linux_fpregset): New variables.
> 	(sh_linux_regset_from_core_section): New function.
> 	(sh_linux_init_abi): Call set_gdbarch_regset_from_core_section.

It seems a shame that this code is almost a complete duplication of
the code in shnbsd.  I think we can avoid that simply by having an
array in the SH tdep structure that provides the offsets to the various
registers, indexed by register number.

Then the code from shnbsd can be moved to sh-tdep.c and the only
remaining bit is to initialize the array appropriately in shbnsd-tdep
and sh-linux-tdep.

-- 
Joel


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