• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision6b14ba038ebb1a11a9b5537ab3a27dc47a38103d (tree)
l'heure2003-05-18 00:34:57
AuteurMark Kettenis <kettenis@gnu....>
CommiterMark Kettenis

Message de Log

* 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.

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,19 @@
11 2003-05-17 Mark Kettenis <kettenis@gnu.org>
22
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+
317 * config/i386/x86-64linux.mt (GDB_MULTI_ARCH): Add back definition.
418
519 Revise the x86_64 (sub)taget.
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -81,7 +81,7 @@ i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
8181
8282 The instruction sequence for normal signals is
8383 pop %eax
84- mov $0x77,%eax
84+ mov $0x77, %eax
8585 int $0x80
8686 or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80.
8787
@@ -103,17 +103,17 @@ i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
103103 to the ones used by the kernel. Therefore, these trampolines are
104104 supported too. */
105105
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
112112
113113 static const unsigned char linux_sigtramp_code[] =
114114 {
115115 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 */
117117 LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */
118118 };
119119
@@ -167,20 +167,20 @@ i386_linux_sigtramp_start (CORE_ADDR pc)
167167
168168 /* This function does the same for RT signals. Here the instruction
169169 sequence is
170- mov $0xad,%eax
170+ mov $0xad, %eax
171171 int $0x80
172172 or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80.
173173
174174 The effect is to call the system call rt_sigreturn. */
175175
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
180180
181181 static const unsigned char linux_rt_sigtramp_code[] =
182182 {
183- LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad,%eax */
183+ LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad, %eax */
184184 LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */
185185 };
186186
@@ -239,6 +239,9 @@ i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
239239 || strcmp ("__restore_rt", name) == 0);
240240 }
241241
242+/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
243+#define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20
244+
242245 /* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp
243246 routine, return the address of the associated sigcontext structure. */
244247
@@ -269,11 +272,14 @@ i386_linux_sigcontext_addr (struct frame_info *next_frame)
269272 pc = i386_linux_rt_sigtramp_start (frame_pc_unwind (next_frame));
270273 if (pc)
271274 {
275+ CORE_ADDR ucontext_addr;
276+
272277 /* The sigcontext structure is part of the user context. A
273278 pointer to the user context is passed as the third argument
274279 to the signal handler. */
275280 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;
277283 }
278284
279285 error ("Couldn't recognize signal trampoline.");
@@ -313,7 +319,7 @@ i386_linux_write_pc (CORE_ADDR pc, ptid_t ptid)
313319 be considered too special-purpose for general consumption. */
314320
315321 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)
317323 {
318324 struct objfile *objfile;
319325
@@ -326,7 +332,7 @@ find_minsym_and_objfile (char *name, struct objfile **objfile_p)
326332 if (SYMBOL_LINKAGE_NAME (msym)
327333 && strcmp (SYMBOL_LINKAGE_NAME (msym), name) == 0)
328334 {
329- *objfile_p = objfile;
335+ *objfilep = objfile;
330336 return msym;
331337 }
332338 }
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -969,7 +969,7 @@ i386_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
969969 CORE_ADDR fp;
970970
971971 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);
973973
974974 return frame_id_build (fp + 8, frame_pc_unwind (next_frame));
975975 }