This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH][SH] Implement core-file support for sh-linux
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Andrew Stubbs <ams at codesourcery dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 13 Oct 2009 21:55:58 -0700
- Subject: Re: [PATCH][SH] Implement core-file support for sh-linux
- References: <4AD33C69.2070301@codesourcery.com>
> 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