GNU Binutils with patches for OS216
Revisión | 6b14ba038ebb1a11a9b5537ab3a27dc47a38103d (tree) |
---|---|
Tiempo | 2003-05-18 00:34:57 |
Autor | Mark Kettenis <kettenis@gnu....> |
Commiter | Mark Kettenis |
* i386-tdep.c (i386_unwind_dummy_id): Use extract_unsigned_integer
instead of extract_typed_address for consistency with the rest of
the code in this file.
* i386-linux-tdep.c: Fix formatting in some comments.
(LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0,
LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1,
LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2,
LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0,
LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop
redundant parentheses.
(I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define.
(i386_linux_sigcontext_addr): Use it.
(find_minsym_and_objfile): Change name of second argument.
@@ -1,5 +1,19 @@ | ||
1 | 1 | 2003-05-17 Mark Kettenis <kettenis@gnu.org> |
2 | 2 | |
3 | + * i386-tdep.c (i386_unwind_dummy_id): Use extract_unsigned_integer | |
4 | + instead of extract_typed_address for consistency with the rest of | |
5 | + the code in this file. | |
6 | + * i386-linux-tdep.c: Fix formatting in some comments. | |
7 | + (LINUX_SIGTRAMP_INSN0, LINUX_SIGTRAMP_OFFSET0, | |
8 | + LINUX_SIGTRAMP_INSN1, LINUX_SIGTRAMP_OFFSET1, | |
9 | + LINUX_SIGTRAMP_INSN2, LINUX_SIGTRAMP_OFFSET2, | |
10 | + LINUX_RT_SIGTRAMP_INSN0, LINUX_RT_SIGTRAMP_OFFSET0, | |
11 | + LINUX_RT_SIGTRAMP_INSN1, LINUX_RT_SIGTRAMP_OFFSET1): Drop | |
12 | + redundant parentheses. | |
13 | + (I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET): New define. | |
14 | + (i386_linux_sigcontext_addr): Use it. | |
15 | + (find_minsym_and_objfile): Change name of second argument. | |
16 | + | |
3 | 17 | * config/i386/x86-64linux.mt (GDB_MULTI_ARCH): Add back definition. |
4 | 18 | |
5 | 19 | Revise the x86_64 (sub)taget. |
@@ -81,7 +81,7 @@ i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, | ||
81 | 81 | |
82 | 82 | The instruction sequence for normal signals is |
83 | 83 | pop %eax |
84 | - mov $0x77,%eax | |
84 | + mov $0x77, %eax | |
85 | 85 | int $0x80 |
86 | 86 | or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80. |
87 | 87 |
@@ -103,17 +103,17 @@ i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, | ||
103 | 103 | to the ones used by the kernel. Therefore, these trampolines are |
104 | 104 | supported too. */ |
105 | 105 | |
106 | -#define LINUX_SIGTRAMP_INSN0 (0x58) /* pop %eax */ | |
107 | -#define LINUX_SIGTRAMP_OFFSET0 (0) | |
108 | -#define LINUX_SIGTRAMP_INSN1 (0xb8) /* mov $NNNN,%eax */ | |
109 | -#define LINUX_SIGTRAMP_OFFSET1 (1) | |
110 | -#define LINUX_SIGTRAMP_INSN2 (0xcd) /* int */ | |
111 | -#define LINUX_SIGTRAMP_OFFSET2 (6) | |
106 | +#define LINUX_SIGTRAMP_INSN0 0x58 /* pop %eax */ | |
107 | +#define LINUX_SIGTRAMP_OFFSET0 0 | |
108 | +#define LINUX_SIGTRAMP_INSN1 0xb8 /* mov $NNNN, %eax */ | |
109 | +#define LINUX_SIGTRAMP_OFFSET1 1 | |
110 | +#define LINUX_SIGTRAMP_INSN2 0xcd /* int */ | |
111 | +#define LINUX_SIGTRAMP_OFFSET2 6 | |
112 | 112 | |
113 | 113 | static const unsigned char linux_sigtramp_code[] = |
114 | 114 | { |
115 | 115 | LINUX_SIGTRAMP_INSN0, /* pop %eax */ |
116 | - LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77,%eax */ | |
116 | + LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77, %eax */ | |
117 | 117 | LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */ |
118 | 118 | }; |
119 | 119 |
@@ -167,20 +167,20 @@ i386_linux_sigtramp_start (CORE_ADDR pc) | ||
167 | 167 | |
168 | 168 | /* This function does the same for RT signals. Here the instruction |
169 | 169 | sequence is |
170 | - mov $0xad,%eax | |
170 | + mov $0xad, %eax | |
171 | 171 | int $0x80 |
172 | 172 | or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80. |
173 | 173 | |
174 | 174 | The effect is to call the system call rt_sigreturn. */ |
175 | 175 | |
176 | -#define LINUX_RT_SIGTRAMP_INSN0 (0xb8) /* mov $NNNN,%eax */ | |
177 | -#define LINUX_RT_SIGTRAMP_OFFSET0 (0) | |
178 | -#define LINUX_RT_SIGTRAMP_INSN1 (0xcd) /* int */ | |
179 | -#define LINUX_RT_SIGTRAMP_OFFSET1 (5) | |
176 | +#define LINUX_RT_SIGTRAMP_INSN0 0xb8 /* mov $NNNN, %eax */ | |
177 | +#define LINUX_RT_SIGTRAMP_OFFSET0 0 | |
178 | +#define LINUX_RT_SIGTRAMP_INSN1 0xcd /* int */ | |
179 | +#define LINUX_RT_SIGTRAMP_OFFSET1 5 | |
180 | 180 | |
181 | 181 | static const unsigned char linux_rt_sigtramp_code[] = |
182 | 182 | { |
183 | - LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad,%eax */ | |
183 | + LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad, %eax */ | |
184 | 184 | LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */ |
185 | 185 | }; |
186 | 186 |
@@ -239,6 +239,9 @@ i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name) | ||
239 | 239 | || strcmp ("__restore_rt", name) == 0); |
240 | 240 | } |
241 | 241 | |
242 | +/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */ | |
243 | +#define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20 | |
244 | + | |
242 | 245 | /* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp |
243 | 246 | routine, return the address of the associated sigcontext structure. */ |
244 | 247 |
@@ -269,11 +272,14 @@ i386_linux_sigcontext_addr (struct frame_info *next_frame) | ||
269 | 272 | pc = i386_linux_rt_sigtramp_start (frame_pc_unwind (next_frame)); |
270 | 273 | if (pc) |
271 | 274 | { |
275 | + CORE_ADDR ucontext_addr; | |
276 | + | |
272 | 277 | /* The sigcontext structure is part of the user context. A |
273 | 278 | pointer to the user context is passed as the third argument |
274 | 279 | to the signal handler. */ |
275 | 280 | read_memory (sp + 8, 4, buf); |
276 | - return extract_unsigned_integer (buf, 4) + 20; | |
281 | + ucontext_addr = extract_unsigned_integer (buf, 4) + 20; | |
282 | + return ucontext_addr + I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET; | |
277 | 283 | } |
278 | 284 | |
279 | 285 | error ("Couldn't recognize signal trampoline."); |
@@ -313,7 +319,7 @@ i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid) | ||
313 | 319 | be considered too special-purpose for general consumption. */ |
314 | 320 | |
315 | 321 | static struct minimal_symbol * |
316 | -find_minsym_and_objfile (char *name, struct objfile **objfile_p) | |
322 | +find_minsym_and_objfile (char *name, struct objfile **objfilep) | |
317 | 323 | { |
318 | 324 | struct objfile *objfile; |
319 | 325 |
@@ -326,7 +332,7 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p) | ||
326 | 332 | if (SYMBOL_LINKAGE_NAME (msym) |
327 | 333 | && strcmp (SYMBOL_LINKAGE_NAME (msym), name) == 0) |
328 | 334 | { |
329 | - *objfile_p = objfile; | |
335 | + *objfilep = objfile; | |
330 | 336 | return msym; |
331 | 337 | } |
332 | 338 | } |
@@ -969,7 +969,7 @@ i386_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) | ||
969 | 969 | CORE_ADDR fp; |
970 | 970 | |
971 | 971 | frame_unwind_register (next_frame, I386_EBP_REGNUM, buf); |
972 | - fp = extract_typed_address (buf, builtin_type_void_data_ptr); | |
972 | + fp = extract_unsigned_integer (buf, 4); | |
973 | 973 | |
974 | 974 | return frame_id_build (fp + 8, frame_pc_unwind (next_frame)); |
975 | 975 | } |