From: Ulrich Weigand Date: Fri, 5 Sep 2008 11:44:24 +0000 (+0000) Subject: * m68k-tdep.h (m68kbsd_fpreg_offset): Add gdbarch parameter. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ba384252317623eac67489bfb810b158615fe5b;p=binutils-gdb.git * m68k-tdep.h (m68kbsd_fpreg_offset): Add gdbarch parameter. * m68kbsd-tdep.c (m68kbsd_fpreg_offset): Add gdbarch paramter. Use it instead of current_gdbarch. (m68kbsd_supply_fpregset): Update call. * m68kbsd-nat.c (m68kbsd_supply_fpregset): Likewise. (m68kbsd_collect_fpregset): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8bf2f079301..de24f85f7a1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2008-09-05 Ulrich Weigand + + * m68k-tdep.h (m68kbsd_fpreg_offset): Add gdbarch parameter. + * m68kbsd-tdep.c (m68kbsd_fpreg_offset): Add gdbarch paramter. + Use it instead of current_gdbarch. + (m68kbsd_supply_fpregset): Update call. + * m68kbsd-nat.c (m68kbsd_supply_fpregset): Likewise. + (m68kbsd_collect_fpregset): Likewise. + 2008-09-05 Ulrich Weigand * cris-tdep.c (cris_version, cris_mode): Remove. diff --git a/gdb/m68k-tdep.h b/gdb/m68k-tdep.h index 1696d47d86f..68e36f2b290 100644 --- a/gdb/m68k-tdep.h +++ b/gdb/m68k-tdep.h @@ -100,6 +100,6 @@ extern void m68k_svr4_init_abi (struct gdbarch_info, struct gdbarch *); /* Functions exported from m68kbsd-tdep.c. */ -extern int m68kbsd_fpreg_offset (int regnum); +extern int m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum); #endif /* m68k-tdep.h */ diff --git a/gdb/m68kbsd-nat.c b/gdb/m68kbsd-nat.c index efa93a86066..bd3e352fb2a 100644 --- a/gdb/m68kbsd-nat.c +++ b/gdb/m68kbsd-nat.c @@ -59,12 +59,13 @@ m68kbsd_supply_gregset (struct regcache *regcache, const void *gregs) static void m68kbsd_supply_fpregset (struct regcache *regcache, const void *fpregs) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); const char *regs = fpregs; int regnum; for (regnum = M68K_FP0_REGNUM; regnum <= M68K_FPI_REGNUM; regnum++) regcache_raw_supply (regcache, regnum, - regs + m68kbsd_fpreg_offset (regnum)); + regs + m68kbsd_fpreg_offset (gdbarch, regnum)); } /* Collect the general-purpose registers from REGCACHE and store them @@ -91,13 +92,15 @@ static void m68kbsd_collect_fpregset (struct regcache *regcache, void *fpregs, int regnum) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); char *regs = fpregs; int i; for (i = M68K_FP0_REGNUM; i <= M68K_FPI_REGNUM; i++) { if (regnum == -1 || regnum == i) - regcache_raw_collect (regcache, i, regs + m68kbsd_fpreg_offset (i)); + regcache_raw_collect (regcache, i, + regs + m68kbsd_fpreg_offset (gdbarch, i)); } } diff --git a/gdb/m68kbsd-tdep.c b/gdb/m68kbsd-tdep.c index f0478e6d3f5..a74c493dee0 100644 --- a/gdb/m68kbsd-tdep.c +++ b/gdb/m68kbsd-tdep.c @@ -42,9 +42,9 @@ #define M68KBSD_SIZEOF_FPREGS (((8 * 3) + 3) * 4) int -m68kbsd_fpreg_offset (int regnum) +m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum) { - int fp_len = TYPE_LENGTH (gdbarch_register_type (current_gdbarch, regnum)); + int fp_len = TYPE_LENGTH (gdbarch_register_type (gdbarch, regnum)); if (regnum >= M68K_FPC_REGNUM) return 8 * fp_len + (regnum - M68K_FPC_REGNUM) * 4; @@ -61,6 +61,7 @@ m68kbsd_supply_fpregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *fpregs, size_t len) { + struct gdbarch *gdbarch = get_regcache_arch (regcache); const gdb_byte *regs = fpregs; int i; @@ -69,7 +70,8 @@ m68kbsd_supply_fpregset (const struct regset *regset, for (i = M68K_FP0_REGNUM; i <= M68K_PC_REGNUM; i++) { if (regnum == i || regnum == -1) - regcache_raw_supply (regcache, i, regs + m68kbsd_fpreg_offset (i)); + regcache_raw_supply (regcache, i, + regs + m68kbsd_fpreg_offset (gdbarch, i)); } }