s390x-use-elf-gdb_fpregset_t.patch (5315B)
1 The s390 versions of fill_gregset / supply_gregset and fill_fpregset / 2 supply_fpregset declare the data structure to be filled or supplied from 3 as gregset_t and fpregset_t, respectively, instead of gdb_gregset_t and 4 gdb_fpregset_t. This is incompatible with the declaration of these 5 functions in gregset.h. 6 gdb/ChangeLog: 7 8 * s390-linux-nat.c (supply_gregset, fill_gregset, fetch_regs) 9 (store_regs): Replace gregset_t by gdb_gregset_t. 10 (supply_fpregset, fill_fpregset, fetch_fpregs, store_fpregs): 11 Replace fpregset_t by gdb_fpregset_t. 12 Credit to Andreas Arnez at IBM 13 14 --- 15 16 diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c 17 index 2c60562..c48a35a 100644 18 --- a/gdb/s390-linux-nat.c 19 +++ b/gdb/s390-linux-nat.c 20 @@ -153,7 +153,7 @@ static s390_linux_nat_target the_s390_linux_nat_target; 21 make them look like 32-bit registers. */ 22 23 void 24 -supply_gregset (struct regcache *regcache, const gregset_t *regp) 25 +supply_gregset (struct regcache *regcache, const gdb_gregset_t *regp) 26 { 27 #ifdef __s390x__ 28 struct gdbarch *gdbarch = regcache->arch (); 29 @@ -164,7 +164,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) 30 gdb_byte buf[4]; 31 32 regcache_supply_regset (&s390_64_gregset, regcache, -1, 33 - regp, sizeof (gregset_t)); 34 + regp, sizeof (gdb_gregset_t)); 35 pswm = extract_unsigned_integer ((const gdb_byte *) regp 36 + S390_PSWM_OFFSET, 8, byte_order); 37 pswa = extract_unsigned_integer ((const gdb_byte *) regp 38 @@ -179,7 +179,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) 39 #endif 40 41 regcache_supply_regset (&s390_gregset, regcache, -1, regp, 42 - sizeof (gregset_t)); 43 + sizeof (gdb_gregset_t)); 44 } 45 46 /* Fill register REGNO (if it is a general-purpose register) in 47 @@ -187,14 +187,14 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp) 48 do this for all registers. */ 49 50 void 51 -fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno) 52 +fill_gregset (const struct regcache *regcache, gdb_gregset_t *regp, int regno) 53 { 54 #ifdef __s390x__ 55 struct gdbarch *gdbarch = regcache->arch (); 56 if (gdbarch_ptr_bit (gdbarch) == 32) 57 { 58 regcache_collect_regset (&s390_64_gregset, regcache, regno, 59 - regp, sizeof (gregset_t)); 60 + regp, sizeof (gdb_gregset_t)); 61 62 if (regno == -1 63 || regno == S390_PSWM_REGNUM || regno == S390_PSWA_REGNUM) 64 @@ -231,26 +231,27 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno) 65 #endif 66 67 regcache_collect_regset (&s390_gregset, regcache, regno, regp, 68 - sizeof (gregset_t)); 69 + sizeof (gdb_gregset_t)); 70 } 71 72 /* Fill GDB's register array with the floating-point register values 73 in *REGP. */ 74 void 75 -supply_fpregset (struct regcache *regcache, const fpregset_t *regp) 76 +supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *regp) 77 { 78 regcache_supply_regset (&s390_fpregset, regcache, -1, regp, 79 - sizeof (fpregset_t)); 80 + sizeof (gdb_fpregset_t)); 81 } 82 83 /* Fill register REGNO (if it is a general-purpose register) in 84 *REGP with the value in GDB's register array. If REGNO is -1, 85 do this for all registers. */ 86 void 87 -fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno) 88 +fill_fpregset (const struct regcache *regcache, gdb_fpregset_t *regp, 89 + int regno) 90 { 91 regcache_collect_regset (&s390_fpregset, regcache, regno, regp, 92 - sizeof (fpregset_t)); 93 + sizeof (gdb_fpregset_t)); 94 } 95 96 /* Find the TID for the current inferior thread to use with ptrace. */ 97 @@ -270,7 +271,7 @@ s390_inferior_tid (void) 98 static void 99 fetch_regs (struct regcache *regcache, int tid) 100 { 101 - gregset_t regs; 102 + gdb_gregset_t regs; 103 ptrace_area parea; 104 105 parea.len = sizeof (regs); 106 @@ -279,7 +280,7 @@ fetch_regs (struct regcache *regcache, int tid) 107 if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) 108 perror_with_name (_("Couldn't get registers")); 109 110 - supply_gregset (regcache, (const gregset_t *) ®s); 111 + supply_gregset (regcache, (const gdb_gregset_t *) ®s); 112 } 113 114 /* Store all valid general-purpose registers in GDB's register cache 115 @@ -287,7 +288,7 @@ fetch_regs (struct regcache *regcache, int tid) 116 static void 117 store_regs (const struct regcache *regcache, int tid, int regnum) 118 { 119 - gregset_t regs; 120 + gdb_gregset_t regs; 121 ptrace_area parea; 122 123 parea.len = sizeof (regs); 124 @@ -307,7 +308,7 @@ store_regs (const struct regcache *regcache, int tid, int regnum) 125 static void 126 fetch_fpregs (struct regcache *regcache, int tid) 127 { 128 - fpregset_t fpregs; 129 + gdb_fpregset_t fpregs; 130 ptrace_area parea; 131 132 parea.len = sizeof (fpregs); 133 @@ -316,7 +317,7 @@ fetch_fpregs (struct regcache *regcache, int tid) 134 if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) 135 perror_with_name (_("Couldn't get floating point status")); 136 137 - supply_fpregset (regcache, (const fpregset_t *) &fpregs); 138 + supply_fpregset (regcache, (const gdb_fpregset_t *) &fpregs); 139 } 140 141 /* Store all valid floating-point registers in GDB's register cache 142 @@ -324,7 +325,7 @@ fetch_fpregs (struct regcache *regcache, int tid) 143 static void 144 store_fpregs (const struct regcache *regcache, int tid, int regnum) 145 { 146 - fpregset_t fpregs; 147 + gdb_fpregset_t fpregs; 148 ptrace_area parea; 149 150 parea.len = sizeof (fpregs);