SPARC: Replace regset_alloc() invocations by static regset structures.
This commit is contained in:
parent
b4fd25c939
commit
b13feb94aa
|
@ -1,3 +1,26 @@
|
|||
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
|
||||
* sparc-linux-tdep.c (sparc32_linux_gregset)
|
||||
(sparc32_linux_fpregset): New static regset structures.
|
||||
(sparc32_linux_init_abi): Drop dynamic regset allocations.
|
||||
* sparc-tdep.h (struct gdbarch_tdep): Constify 'gregset' and
|
||||
'fpregset' fields.
|
||||
* sparc64-linux-tdep.c: (sparc64_linux_gregset)
|
||||
(sparc64_linux_fpregset): New static regset structures.
|
||||
(sparc64_linux_init_abi): Drop dynamic regset allocations.
|
||||
* sparc64fbsd-tdep.c (sparc64fbsd_gregset, sparc64fbsd_fpregset):
|
||||
New static regset structures.
|
||||
(sparc64fbsd_init_abi): Drop dynamic regset allocations.
|
||||
* sparc64nbsd-tdep.c (sparc64nbsd_gregset, sparc64nbsd_fpregset):
|
||||
New static regset structures.
|
||||
(sparc64nbsd_init_abi): Drop dynamic regset allocations.
|
||||
* sparc64obsd-tdep.c (sparc64obsd_gregset, sparc64obsd_fpregset):
|
||||
New static regset structures.
|
||||
(sparc64obsd_init_abi): Drop dynamic regset allocations.
|
||||
* sparcnbsd-tdep.c (sparc32nbsd_gregset, sparc32nbsd_fpregset):
|
||||
New static regset structures.
|
||||
(sparc32nbsd_init_abi): Drop dynamic regset allocations.
|
||||
|
||||
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
|
||||
* sparc-linux-nat.c (supply_gregset, supply_fpregset)
|
||||
|
|
|
@ -403,6 +403,20 @@ sparc32_linux_gdb_signal_to_target (struct gdbarch *gdbarch,
|
|||
|
||||
|
||||
|
||||
static const struct regset sparc32_linux_gregset =
|
||||
{
|
||||
NULL,
|
||||
sparc32_linux_supply_core_gregset,
|
||||
sparc32_linux_collect_core_gregset
|
||||
};
|
||||
|
||||
static const struct regset sparc32_linux_fpregset =
|
||||
{
|
||||
NULL,
|
||||
sparc32_linux_supply_core_fpregset,
|
||||
sparc32_linux_collect_core_fpregset
|
||||
};
|
||||
|
||||
static void
|
||||
sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
|
@ -410,12 +424,10 @@ sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
|||
|
||||
linux_init_abi (info, gdbarch);
|
||||
|
||||
tdep->gregset = regset_alloc (gdbarch, sparc32_linux_supply_core_gregset,
|
||||
sparc32_linux_collect_core_gregset);
|
||||
tdep->gregset = &sparc32_linux_gregset;
|
||||
tdep->sizeof_gregset = 152;
|
||||
|
||||
tdep->fpregset = regset_alloc (gdbarch, sparc32_linux_supply_core_fpregset,
|
||||
sparc32_linux_collect_core_fpregset);
|
||||
tdep->fpregset = &sparc32_linux_fpregset;
|
||||
tdep->sizeof_fpregset = 396;
|
||||
|
||||
tramp_frame_prepend_unwinder (gdbarch, &sparc32_linux_sigframe);
|
||||
|
|
|
@ -58,9 +58,9 @@ struct gdbarch_tdep
|
|||
int npc_regnum;
|
||||
|
||||
/* Register sets. */
|
||||
struct regset *gregset;
|
||||
const struct regset *gregset;
|
||||
size_t sizeof_gregset;
|
||||
struct regset *fpregset;
|
||||
const struct regset *fpregset;
|
||||
size_t sizeof_fpregset;
|
||||
|
||||
/* Offset of saved PC in jmp_buf. */
|
||||
|
|
|
@ -280,6 +280,20 @@ sparc64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
|
|||
|
||||
|
||||
|
||||
static const struct regset sparc64_linux_gregset =
|
||||
{
|
||||
NULL,
|
||||
sparc64_linux_supply_core_gregset,
|
||||
sparc64_linux_collect_core_gregset
|
||||
};
|
||||
|
||||
static const struct regset sparc64_linux_fpregset =
|
||||
{
|
||||
NULL,
|
||||
sparc64_linux_supply_core_fpregset,
|
||||
sparc64_linux_collect_core_fpregset
|
||||
};
|
||||
|
||||
static void
|
||||
sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
|
@ -287,12 +301,10 @@ sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
|||
|
||||
linux_init_abi (info, gdbarch);
|
||||
|
||||
tdep->gregset = regset_alloc (gdbarch, sparc64_linux_supply_core_gregset,
|
||||
sparc64_linux_collect_core_gregset);
|
||||
tdep->gregset = &sparc64_linux_gregset;
|
||||
tdep->sizeof_gregset = 288;
|
||||
|
||||
tdep->fpregset = regset_alloc (gdbarch, sparc64_linux_supply_core_fpregset,
|
||||
sparc64_linux_collect_core_fpregset);
|
||||
tdep->fpregset = &sparc64_linux_fpregset;
|
||||
tdep->sizeof_fpregset = 280;
|
||||
|
||||
tramp_frame_prepend_unwinder (gdbarch, &sparc64_linux_rt_sigframe);
|
||||
|
|
|
@ -209,17 +209,25 @@ static const struct frame_unwind sparc64fbsd_sigtramp_frame_unwind =
|
|||
};
|
||||
|
||||
|
||||
static const struct regset sparc64fbsd_gregset =
|
||||
{
|
||||
NULL, sparc64fbsd_supply_gregset, sparc64fbsd_collect_gregset
|
||||
};
|
||||
|
||||
static const struct regset sparc64fbsd_fpregset =
|
||||
{
|
||||
NULL, sparc64fbsd_supply_fpregset, sparc64fbsd_collect_fpregset
|
||||
};
|
||||
|
||||
static void
|
||||
sparc64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
tdep->gregset = regset_alloc (gdbarch, sparc64fbsd_supply_gregset,
|
||||
sparc64fbsd_collect_gregset);
|
||||
tdep->gregset = &sparc64fbsd_gregset;
|
||||
tdep->sizeof_gregset = 256;
|
||||
|
||||
tdep->fpregset = regset_alloc (gdbarch, sparc64fbsd_supply_fpregset,
|
||||
sparc64fbsd_collect_fpregset);
|
||||
tdep->fpregset = &sparc64fbsd_fpregset;
|
||||
tdep->sizeof_fpregset = 272;
|
||||
|
||||
frame_unwind_append_unwinder (gdbarch, &sparc64fbsd_sigtramp_frame_unwind);
|
||||
|
|
|
@ -237,15 +237,25 @@ static const struct frame_unwind sparc64nbsd_sigcontext_frame_unwind =
|
|||
};
|
||||
|
||||
|
||||
static const struct regset sparc64nbsd_gregset =
|
||||
{
|
||||
NULL, sparc64nbsd_supply_gregset, NULL
|
||||
};
|
||||
|
||||
static const struct regset sparc64nbsd_fpregset =
|
||||
{
|
||||
NULL, sparc64nbsd_supply_fpregset, NULL
|
||||
};
|
||||
|
||||
static void
|
||||
sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
tdep->gregset = regset_alloc (gdbarch, sparc64nbsd_supply_gregset, NULL);
|
||||
tdep->gregset = &sparc64nbsd_gregset;
|
||||
tdep->sizeof_gregset = 160;
|
||||
|
||||
tdep->fpregset = regset_alloc (gdbarch, sparc64nbsd_supply_fpregset, NULL);
|
||||
tdep->fpregset = &sparc64nbsd_fpregset;
|
||||
tdep->sizeof_fpregset = 272;
|
||||
|
||||
/* Make sure we can single-step "new" syscalls. */
|
||||
|
|
|
@ -403,15 +403,24 @@ sparc64obsd_collect_uthread(const struct regcache *regcache,
|
|||
}
|
||||
|
||||
|
||||
static const struct regset sparc64obsd_gregset =
|
||||
{
|
||||
NULL, sparc64obsd_supply_gregset, NULL
|
||||
};
|
||||
|
||||
static const struct regset sparc64obsd_fpregset =
|
||||
{
|
||||
NULL, sparc64obsd_supply_fpregset, NULL
|
||||
};
|
||||
|
||||
static void
|
||||
sparc64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
tdep->gregset = regset_alloc (gdbarch, sparc64obsd_supply_gregset, NULL);
|
||||
tdep->gregset = &sparc64obsd_gregset;
|
||||
tdep->sizeof_gregset = 288;
|
||||
|
||||
tdep->fpregset = regset_alloc (gdbarch, sparc64obsd_supply_fpregset, NULL);
|
||||
tdep->fpregset = &sparc64obsd_fpregset;
|
||||
tdep->sizeof_fpregset = 272;
|
||||
|
||||
/* Make sure we can single-step "new" syscalls. */
|
||||
|
|
|
@ -283,6 +283,16 @@ sparcnbsd_step_trap (struct frame_info *frame, unsigned long insn)
|
|||
}
|
||||
|
||||
|
||||
static const struct regset sparc32nbsd_gregset =
|
||||
{
|
||||
NULL, sparc32nbsd_supply_gregset, NULL
|
||||
};
|
||||
|
||||
static const struct regset sparc32nbsd_fpregset =
|
||||
{
|
||||
NULL, sparc32nbsd_supply_fpregset, NULL
|
||||
};
|
||||
|
||||
static void
|
||||
sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
|
@ -292,10 +302,10 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
|||
set_gdbarch_long_double_bit (gdbarch, 64);
|
||||
set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
|
||||
|
||||
tdep->gregset = regset_alloc (gdbarch, sparc32nbsd_supply_gregset, NULL);
|
||||
tdep->gregset = &sparc32nbsd_gregset;
|
||||
tdep->sizeof_gregset = 20 * 4;
|
||||
|
||||
tdep->fpregset = regset_alloc (gdbarch, sparc32nbsd_supply_fpregset, NULL);
|
||||
tdep->fpregset = &sparc32nbsd_fpregset;
|
||||
tdep->sizeof_fpregset = 33 * 4;
|
||||
|
||||
/* Make sure we can single-step "new" syscalls. */
|
||||
|
|
Loading…
Reference in New Issue