/* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger.
- Copyright (C) 2003-2014 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "gdbcore.h"
-#include <string.h>
#include "regcache.h"
#include "mn10300-tdep.h"
#include "bfd.h"
#include "trad-frame.h"
#include "tramp-frame.h"
#include "linux-tdep.h"
+#include "gdbarch.h"
/* Transliterated from <asm-mn10300/elf.h>... */
#define MN10300_ELF_NGREG 28
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- char zerobuf[MAX_REGISTER_SIZE];
const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs;
int i;
- gdb_assert (len == sizeof (mn10300_elf_gregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_gregset_t));
switch (regnum) {
case E_D0_REGNUM:
- regcache_raw_supply (regcache, E_D0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
+ regcache->raw_supply (E_D0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
break;
case E_D1_REGNUM:
- regcache_raw_supply (regcache, E_D1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
+ regcache->raw_supply (E_D1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
break;
case E_D2_REGNUM:
- regcache_raw_supply (regcache, E_D2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
+ regcache->raw_supply (E_D2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
break;
case E_D3_REGNUM:
- regcache_raw_supply (regcache, E_D3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
+ regcache->raw_supply (E_D3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
break;
case E_A0_REGNUM:
- regcache_raw_supply (regcache, E_A0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
+ regcache->raw_supply (E_A0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
break;
case E_A1_REGNUM:
- regcache_raw_supply (regcache, E_A1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
+ regcache->raw_supply (E_A1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
break;
case E_A2_REGNUM:
- regcache_raw_supply (regcache, E_A2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
+ regcache->raw_supply (E_A2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
break;
case E_A3_REGNUM:
- regcache_raw_supply (regcache, E_A3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
+ regcache->raw_supply (E_A3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
break;
case E_SP_REGNUM:
- regcache_raw_supply (regcache, E_SP_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
+ regcache->raw_supply (E_SP_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
break;
case E_PC_REGNUM:
- regcache_raw_supply (regcache, E_PC_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
+ regcache->raw_supply (E_PC_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
break;
case E_MDR_REGNUM:
- regcache_raw_supply (regcache, E_MDR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
+ regcache->raw_supply (E_MDR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
break;
case E_PSW_REGNUM:
- regcache_raw_supply (regcache, E_PSW_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
+ regcache->raw_supply (E_PSW_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
break;
case E_LIR_REGNUM:
- regcache_raw_supply (regcache, E_LIR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
+ regcache->raw_supply (E_LIR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
break;
case E_LAR_REGNUM:
- regcache_raw_supply (regcache, E_LAR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
+ regcache->raw_supply (E_LAR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
break;
case E_MDRQ_REGNUM:
- regcache_raw_supply (regcache, E_MDRQ_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
+ regcache->raw_supply (E_MDRQ_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
break;
case E_E0_REGNUM:
- regcache_raw_supply (regcache, E_E0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
+ regcache->raw_supply (E_E0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
break;
case E_E1_REGNUM:
- regcache_raw_supply (regcache, E_E1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
+ regcache->raw_supply (E_E1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
break;
case E_E2_REGNUM:
- regcache_raw_supply (regcache, E_E2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
+ regcache->raw_supply (E_E2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
break;
case E_E3_REGNUM:
- regcache_raw_supply (regcache, E_E3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
+ regcache->raw_supply (E_E3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
break;
case E_E4_REGNUM:
- regcache_raw_supply (regcache, E_E4_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
+ regcache->raw_supply (E_E4_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
break;
case E_E5_REGNUM:
- regcache_raw_supply (regcache, E_E5_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
+ regcache->raw_supply (E_E5_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
break;
case E_E6_REGNUM:
- regcache_raw_supply (regcache, E_E6_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
+ regcache->raw_supply (E_E6_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
break;
case E_E7_REGNUM:
- regcache_raw_supply (regcache, E_E7_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
+ regcache->raw_supply (E_E7_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
break;
/* ssp, msp, and usp are inaccessible. */
case E_E8_REGNUM:
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
- regcache_raw_supply (regcache, E_E8_REGNUM, zerobuf);
+ regcache->raw_supply_zeroed (E_E8_REGNUM);
break;
case E_E9_REGNUM:
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
- regcache_raw_supply (regcache, E_E9_REGNUM, zerobuf);
+ regcache->raw_supply_zeroed (E_E9_REGNUM);
break;
case E_E10_REGNUM:
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
- regcache_raw_supply (regcache, E_E10_REGNUM, zerobuf);
-
+ regcache->raw_supply_zeroed (E_E10_REGNUM);
break;
case E_MCRH_REGNUM:
- regcache_raw_supply (regcache, E_MCRH_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
+ regcache->raw_supply (E_MCRH_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
break;
case E_MCRL_REGNUM:
- regcache_raw_supply (regcache, E_MCRL_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
+ regcache->raw_supply (E_MCRL_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
break;
case E_MCVF_REGNUM:
- regcache_raw_supply (regcache, E_MCVF_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
+ regcache->raw_supply (E_MCVF_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
break;
case E_FPCR_REGNUM:
/* FPCR is numbered among the GP regs, but handled as an FP reg.
break;
case E_FPCR_REGNUM + 1:
/* The two unused registers beyond fpcr are inaccessible. */
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
- regcache_raw_supply (regcache, E_FPCR_REGNUM + 1, zerobuf);
+ regcache->raw_supply_zeroed (E_FPCR_REGNUM + 1);
break;
case E_FPCR_REGNUM + 2:
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
- regcache_raw_supply (regcache, E_FPCR_REGNUM + 2, zerobuf);
+ regcache->raw_supply_zeroed (E_FPCR_REGNUM + 2);
break;
default: /* An error, obviously, but should we error out? */
break;
struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
- const mn10300_elf_fpregset_t *fpregset = fpregs;
+ const mn10300_elf_fpregset_t *fpregset
+ = (const mn10300_elf_fpregset_t *) fpregs;
- gdb_assert (len == sizeof (mn10300_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_fpregset_t));
if (regnum == -1)
{
for (i = 0; i < MN10300_ELF_NFPREG; i++)
am33_supply_fpregset_method (regset, regcache,
- E_FS0_REGNUM + i, fpregs, len);
+ E_FS0_REGNUM + i, fpregs, len);
am33_supply_fpregset_method (regset, regcache,
E_FPCR_REGNUM, fpregs, len);
}
else if (regnum == E_FPCR_REGNUM)
- regcache_raw_supply (regcache, E_FPCR_REGNUM,
- &fpregset->fpcr);
+ regcache->raw_supply (E_FPCR_REGNUM, &fpregset->fpcr);
else if (E_FS0_REGNUM <= regnum
&& regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
- regcache_raw_supply (regcache, regnum,
- &fpregset->fpregs[regnum - E_FS0_REGNUM]);
+ regcache->raw_supply (regnum, &fpregset->fpregs[regnum - E_FS0_REGNUM]);
return;
}
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- mn10300_elf_gregset_t *regp = gregs;
+ mn10300_elf_gregset_t *regp = (gdb_byte (*)[28][4]) gregs;
int i;
- gdb_assert (len == sizeof (mn10300_elf_gregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_gregset_t));
switch (regnum) {
case E_D0_REGNUM:
- regcache_raw_collect (regcache, E_D0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
+ regcache->raw_collect (E_D0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
break;
case E_D1_REGNUM:
- regcache_raw_collect (regcache, E_D1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
+ regcache->raw_collect (E_D1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
break;
case E_D2_REGNUM:
- regcache_raw_collect (regcache, E_D2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
+ regcache->raw_collect (E_D2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
break;
case E_D3_REGNUM:
- regcache_raw_collect (regcache, E_D3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
+ regcache->raw_collect (E_D3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
break;
case E_A0_REGNUM:
- regcache_raw_collect (regcache, E_A0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
+ regcache->raw_collect (E_A0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
break;
case E_A1_REGNUM:
- regcache_raw_collect (regcache, E_A1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
+ regcache->raw_collect (E_A1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
break;
case E_A2_REGNUM:
- regcache_raw_collect (regcache, E_A2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
+ regcache->raw_collect (E_A2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
break;
case E_A3_REGNUM:
- regcache_raw_collect (regcache, E_A3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
+ regcache->raw_collect (E_A3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
break;
case E_SP_REGNUM:
- regcache_raw_collect (regcache, E_SP_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
+ regcache->raw_collect (E_SP_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
break;
case E_PC_REGNUM:
- regcache_raw_collect (regcache, E_PC_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
+ regcache->raw_collect (E_PC_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
break;
case E_MDR_REGNUM:
- regcache_raw_collect (regcache, E_MDR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
+ regcache->raw_collect (E_MDR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
break;
case E_PSW_REGNUM:
- regcache_raw_collect (regcache, E_PSW_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
+ regcache->raw_collect (E_PSW_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
break;
case E_LIR_REGNUM:
- regcache_raw_collect (regcache, E_LIR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
+ regcache->raw_collect (E_LIR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
break;
case E_LAR_REGNUM:
- regcache_raw_collect (regcache, E_LAR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
+ regcache->raw_collect (E_LAR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
break;
case E_MDRQ_REGNUM:
- regcache_raw_collect (regcache, E_MDRQ_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
+ regcache->raw_collect (E_MDRQ_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
break;
case E_E0_REGNUM:
- regcache_raw_collect (regcache, E_E0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
+ regcache->raw_collect (E_E0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
break;
case E_E1_REGNUM:
- regcache_raw_collect (regcache, E_E1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
+ regcache->raw_collect (E_E1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
break;
case E_E2_REGNUM:
- regcache_raw_collect (regcache, E_E2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
+ regcache->raw_collect (E_E2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
break;
case E_E3_REGNUM:
- regcache_raw_collect (regcache, E_E3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
+ regcache->raw_collect (E_E3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
break;
case E_E4_REGNUM:
- regcache_raw_collect (regcache, E_E4_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
+ regcache->raw_collect (E_E4_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
break;
case E_E5_REGNUM:
- regcache_raw_collect (regcache, E_E5_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
+ regcache->raw_collect (E_E5_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
break;
case E_E6_REGNUM:
- regcache_raw_collect (regcache, E_E6_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
+ regcache->raw_collect (E_E6_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
break;
case E_E7_REGNUM:
- regcache_raw_collect (regcache, E_E7_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
+ regcache->raw_collect (E_E7_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
break;
/* ssp, msp, and usp are inaccessible. */
/* The gregset struct has noplace to put this: do nothing. */
break;
case E_MCRH_REGNUM:
- regcache_raw_collect (regcache, E_MCRH_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
+ regcache->raw_collect (E_MCRH_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
break;
case E_MCRL_REGNUM:
- regcache_raw_collect (regcache, E_MCRL_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
+ regcache->raw_collect (E_MCRL_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
break;
case E_MCVF_REGNUM:
- regcache_raw_collect (regcache, E_MCVF_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
+ regcache->raw_collect (E_MCVF_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
break;
case E_FPCR_REGNUM:
/* FPCR is numbered among the GP regs, but handled as an FP reg.
const struct regcache *regcache,
int regnum, void *fpregs, size_t len)
{
- mn10300_elf_fpregset_t *fpregset = fpregs;
+ mn10300_elf_fpregset_t *fpregset = (mn10300_elf_fpregset_t *) fpregs;
- gdb_assert (len == sizeof (mn10300_elf_fpregset_t));
+ gdb_assert (len >= sizeof (mn10300_elf_fpregset_t));
if (regnum == -1)
{
int i;
for (i = 0; i < MN10300_ELF_NFPREG; i++)
am33_collect_fpregset_method (regset, regcache, E_FS0_REGNUM + i,
- fpregs, len);
+ fpregs, len);
am33_collect_fpregset_method (regset, regcache,
E_FPCR_REGNUM, fpregs, len);
}
else if (regnum == E_FPCR_REGNUM)
- regcache_raw_collect (regcache, E_FPCR_REGNUM,
- &fpregset->fpcr);
+ regcache->raw_collect (E_FPCR_REGNUM, &fpregset->fpcr);
else if (E_FS0_REGNUM <= regnum
- && regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
- regcache_raw_collect (regcache, regnum,
- &fpregset->fpregs[regnum - E_FS0_REGNUM]);
+ && regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
+ regcache->raw_collect (regnum, &fpregset->fpregs[regnum - E_FS0_REGNUM]);
return;
}
NULL, am33_supply_fpregset_method, am33_collect_fpregset_method
};
-/* Create a struct regset from a corefile register section. */
+/* Iterate over core file register note sections. */
-static const struct regset *
-am33_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name,
- size_t sect_size)
+static void
+am33_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
- if (sect_size == sizeof (mn10300_elf_fpregset_t))
- return &am33_fpregset;
- else
- return &am33_gregset;
+ cb (".reg", sizeof (mn10300_elf_gregset_t), sizeof (mn10300_elf_gregset_t),
+ &am33_gregset, NULL, cb_data);
+ cb (".reg2", sizeof (mn10300_elf_fpregset_t), sizeof (mn10300_elf_fpregset_t),
+ &am33_fpregset, NULL, cb_data);
}
\f
static void
am33_linux_sigframe_cache_init (const struct tramp_frame *self,
- struct frame_info *this_frame,
- struct trad_frame_cache *this_cache,
- CORE_ADDR func);
+ struct frame_info *this_frame,
+ struct trad_frame_cache *this_cache,
+ CORE_ADDR func);
static const struct tramp_frame am33_linux_sigframe = {
SIGTRAMP_FRAME,
1,
{
/* mov 119,d0 */
- { 0x2c, -1 },
- { 0x77, -1 },
- { 0x00, -1 },
+ { 0x2c, ULONGEST_MAX },
+ { 0x77, ULONGEST_MAX },
+ { 0x00, ULONGEST_MAX },
/* syscall 0 */
- { 0xf0, -1 },
- { 0xe0, -1 },
- { TRAMP_SENTINEL_INSN, -1 }
+ { 0xf0, ULONGEST_MAX },
+ { 0xe0, ULONGEST_MAX },
+ { TRAMP_SENTINEL_INSN, ULONGEST_MAX }
},
am33_linux_sigframe_cache_init
};
1,
{
/* mov 173,d0 */
- { 0x2c, -1 },
- { 0xad, -1 },
- { 0x00, -1 },
+ { 0x2c, ULONGEST_MAX },
+ { 0xad, ULONGEST_MAX },
+ { 0x00, ULONGEST_MAX },
/* syscall 0 */
- { 0xf0, -1 },
- { 0xe0, -1 },
- { TRAMP_SENTINEL_INSN, -1 }
+ { 0xf0, ULONGEST_MAX },
+ { 0xe0, ULONGEST_MAX },
+ { TRAMP_SENTINEL_INSN, ULONGEST_MAX }
},
am33_linux_sigframe_cache_init
};
static void
am33_linux_sigframe_cache_init (const struct tramp_frame *self,
- struct frame_info *this_frame,
- struct trad_frame_cache *this_cache,
- CORE_ADDR func)
+ struct frame_info *this_frame,
+ struct trad_frame_cache *this_cache,
+ CORE_ADDR func)
{
CORE_ADDR sc_base, fpubase;
int i;
}
trad_frame_set_reg_addr (this_cache, E_D0_REGNUM,
- sc_base + AM33_SIGCONTEXT_D0);
+ sc_base + AM33_SIGCONTEXT_D0);
trad_frame_set_reg_addr (this_cache, E_D1_REGNUM,
- sc_base + AM33_SIGCONTEXT_D1);
+ sc_base + AM33_SIGCONTEXT_D1);
trad_frame_set_reg_addr (this_cache, E_D2_REGNUM,
- sc_base + AM33_SIGCONTEXT_D2);
+ sc_base + AM33_SIGCONTEXT_D2);
trad_frame_set_reg_addr (this_cache, E_D3_REGNUM,
- sc_base + AM33_SIGCONTEXT_D3);
+ sc_base + AM33_SIGCONTEXT_D3);
trad_frame_set_reg_addr (this_cache, E_A0_REGNUM,
- sc_base + AM33_SIGCONTEXT_A0);
+ sc_base + AM33_SIGCONTEXT_A0);
trad_frame_set_reg_addr (this_cache, E_A1_REGNUM,
- sc_base + AM33_SIGCONTEXT_A1);
+ sc_base + AM33_SIGCONTEXT_A1);
trad_frame_set_reg_addr (this_cache, E_A2_REGNUM,
- sc_base + AM33_SIGCONTEXT_A2);
+ sc_base + AM33_SIGCONTEXT_A2);
trad_frame_set_reg_addr (this_cache, E_A3_REGNUM,
- sc_base + AM33_SIGCONTEXT_A3);
+ sc_base + AM33_SIGCONTEXT_A3);
trad_frame_set_reg_addr (this_cache, E_E0_REGNUM,
- sc_base + AM33_SIGCONTEXT_E0);
+ sc_base + AM33_SIGCONTEXT_E0);
trad_frame_set_reg_addr (this_cache, E_E1_REGNUM,
- sc_base + AM33_SIGCONTEXT_E1);
+ sc_base + AM33_SIGCONTEXT_E1);
trad_frame_set_reg_addr (this_cache, E_E2_REGNUM,
- sc_base + AM33_SIGCONTEXT_E2);
+ sc_base + AM33_SIGCONTEXT_E2);
trad_frame_set_reg_addr (this_cache, E_E3_REGNUM,
- sc_base + AM33_SIGCONTEXT_E3);
+ sc_base + AM33_SIGCONTEXT_E3);
trad_frame_set_reg_addr (this_cache, E_E4_REGNUM,
- sc_base + AM33_SIGCONTEXT_E4);
+ sc_base + AM33_SIGCONTEXT_E4);
trad_frame_set_reg_addr (this_cache, E_E5_REGNUM,
- sc_base + AM33_SIGCONTEXT_E5);
+ sc_base + AM33_SIGCONTEXT_E5);
trad_frame_set_reg_addr (this_cache, E_E6_REGNUM,
- sc_base + AM33_SIGCONTEXT_E6);
+ sc_base + AM33_SIGCONTEXT_E6);
trad_frame_set_reg_addr (this_cache, E_E7_REGNUM,
- sc_base + AM33_SIGCONTEXT_E7);
+ sc_base + AM33_SIGCONTEXT_E7);
trad_frame_set_reg_addr (this_cache, E_LAR_REGNUM,
- sc_base + AM33_SIGCONTEXT_LAR);
+ sc_base + AM33_SIGCONTEXT_LAR);
trad_frame_set_reg_addr (this_cache, E_LIR_REGNUM,
- sc_base + AM33_SIGCONTEXT_LIR);
+ sc_base + AM33_SIGCONTEXT_LIR);
trad_frame_set_reg_addr (this_cache, E_MDR_REGNUM,
- sc_base + AM33_SIGCONTEXT_MDR);
+ sc_base + AM33_SIGCONTEXT_MDR);
trad_frame_set_reg_addr (this_cache, E_MCVF_REGNUM,
- sc_base + AM33_SIGCONTEXT_MCVF);
+ sc_base + AM33_SIGCONTEXT_MCVF);
trad_frame_set_reg_addr (this_cache, E_MCRL_REGNUM,
- sc_base + AM33_SIGCONTEXT_MCRL);
+ sc_base + AM33_SIGCONTEXT_MCRL);
trad_frame_set_reg_addr (this_cache, E_MDRQ_REGNUM,
- sc_base + AM33_SIGCONTEXT_MDRQ);
+ sc_base + AM33_SIGCONTEXT_MDRQ);
trad_frame_set_reg_addr (this_cache, E_SP_REGNUM,
- sc_base + AM33_SIGCONTEXT_SP);
+ sc_base + AM33_SIGCONTEXT_SP);
trad_frame_set_reg_addr (this_cache, E_PSW_REGNUM,
- sc_base + AM33_SIGCONTEXT_EPSW);
+ sc_base + AM33_SIGCONTEXT_EPSW);
trad_frame_set_reg_addr (this_cache, E_PC_REGNUM,
- sc_base + AM33_SIGCONTEXT_PC);
+ sc_base + AM33_SIGCONTEXT_PC);
fpubase = get_frame_memory_unsigned (this_frame,
- sc_base + AM33_SIGCONTEXT_FPUCONTEXT,
+ sc_base + AM33_SIGCONTEXT_FPUCONTEXT,
4);
if (fpubase)
{
for (i = 0; i < 32; i++)
{
trad_frame_set_reg_addr (this_cache, E_FS0_REGNUM + i,
- fpubase + 4 * i);
+ fpubase + 4 * i);
}
trad_frame_set_reg_addr (this_cache, E_FPCR_REGNUM, fpubase + 4 * 32);
}
{
linux_init_abi (info, gdbarch);
- set_gdbarch_regset_from_core_section (gdbarch,
- am33_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, am33_iterate_over_regset_sections);
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
tramp_frame_prepend_unwinder (gdbarch, &am33_linux_rt_sigframe);
}
-/* Provide a prototype to silence -Wmissing-prototypes. */
-extern initialize_file_ftype _initialize_mn10300_linux_tdep;
-
+void _initialize_mn10300_linux_tdep ();
void
-_initialize_mn10300_linux_tdep (void)
+_initialize_mn10300_linux_tdep ()
{
gdbarch_register_osabi (bfd_arch_mn10300, 0,
GDB_OSABI_LINUX, am33_linux_init_osabi);