Sat Nov 19 13:00:38 2011 UTC ()
Fix passing of floating point registers.


(mlelstv)
diff -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/m68kbsd-tdep.c

cvs diff -r1.1.1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/Attic/m68kbsd-tdep.c (expand / switch to unified diff)

--- src/external/gpl3/gdb/dist/gdb/Attic/m68kbsd-tdep.c 2011/09/24 20:11:18 1.1.1.1
+++ src/external/gpl3/gdb/dist/gdb/Attic/m68kbsd-tdep.c 2011/11/19 13:00:38 1.2
@@ -35,50 +35,50 @@ @@ -35,50 +35,50 @@
35#include "solib-svr4.h" 35#include "solib-svr4.h"
36 36
37/* Core file support. */ 37/* Core file support. */
38 38
39/* Sizeof `struct reg' in <machine/reg.h>. */ 39/* Sizeof `struct reg' in <machine/reg.h>. */
40#define M68KBSD_SIZEOF_GREGS (18 * 4) 40#define M68KBSD_SIZEOF_GREGS (18 * 4)
41 41
42/* Sizeof `struct fpreg' in <machine/reg.h. */ 42/* Sizeof `struct fpreg' in <machine/reg.h. */
43#define M68KBSD_SIZEOF_FPREGS (((8 * 3) + 3) * 4) 43#define M68KBSD_SIZEOF_FPREGS (((8 * 3) + 3) * 4)
44 44
45int 45int
46m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum) 46m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum)
47{ 47{
48 int fp_len = TYPE_LENGTH (gdbarch_register_type (gdbarch, regnum)); 48 int fp_len = TYPE_LENGTH (gdbarch_register_type (gdbarch, M68K_FP0_REGNUM));
49  49
50 if (regnum >= M68K_FPC_REGNUM) 50 if (regnum >= M68K_FPC_REGNUM)
51 return 8 * fp_len + (regnum - M68K_FPC_REGNUM) * 4; 51 return 8 * fp_len + (regnum - M68K_FPC_REGNUM) * 4;
52 52
53 return (regnum - M68K_FP0_REGNUM) * fp_len; 53 return (regnum - M68K_FP0_REGNUM) * fp_len;
54} 54}
55 55
56/* Supply register REGNUM from the buffer specified by FPREGS and LEN 56/* Supply register REGNUM from the buffer specified by FPREGS and LEN
57 in the floating-point register set REGSET to register cache 57 in the floating-point register set REGSET to register cache
58 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ 58 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
59 59
60static void 60static void
61m68kbsd_supply_fpregset (const struct regset *regset, 61m68kbsd_supply_fpregset (const struct regset *regset,
62 struct regcache *regcache, 62 struct regcache *regcache,
63 int regnum, const void *fpregs, size_t len) 63 int regnum, const void *fpregs, size_t len)
64{ 64{
65 struct gdbarch *gdbarch = get_regcache_arch (regcache); 65 struct gdbarch *gdbarch = get_regcache_arch (regcache);
66 const gdb_byte *regs = fpregs; 66 const gdb_byte *regs = fpregs;
67 int i; 67 int i;
68 68
69 gdb_assert (len >= M68KBSD_SIZEOF_FPREGS); 69 gdb_assert (len >= M68KBSD_SIZEOF_FPREGS);
70 70
71 for (i = M68K_FP0_REGNUM; i <= M68K_PC_REGNUM; i++) 71 for (i = M68K_FP0_REGNUM; i <= M68K_FPI_REGNUM; i++)
72 { 72 {
73 if (regnum == i || regnum == -1) 73 if (regnum == i || regnum == -1)
74 regcache_raw_supply (regcache, i, 74 regcache_raw_supply (regcache, i,
75 regs + m68kbsd_fpreg_offset (gdbarch, i)); 75 regs + m68kbsd_fpreg_offset (gdbarch, i));
76 } 76 }
77} 77}
78 78
79/* Supply register REGNUM from the buffer specified by GREGS and LEN 79/* Supply register REGNUM from the buffer specified by GREGS and LEN
80 in the general-purpose register set REGSET to register cache 80 in the general-purpose register set REGSET to register cache
81 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ 81 REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
82 82
83static void 83static void
84m68kbsd_supply_gregset (const struct regset *regset, 84m68kbsd_supply_gregset (const struct regset *regset,