This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Use safe_frame_unwind_memory in i386obsd-tdep.c
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 6 Aug 2004 22:51:36 +0200 (CEST)
- Subject: [PATCH] Use safe_frame_unwind_memory in i386obsd-tdep.c
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@chello.nl>
* i386obsd-tdep.c (i386obsd_sigtramp_p): Use
safe_frame_unwind_memory instead of target_read_memory.
Index: i386obsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-tdep.c,v
retrieving revision 1.19
diff -u -p -r1.19 i386obsd-tdep.c
--- i386obsd-tdep.c 4 Aug 2004 21:07:42 -0000 1.19
+++ i386obsd-tdep.c 6 Aug 2004 20:49:41 -0000
@@ -65,6 +65,7 @@ i386obsd_sigtramp_p (struct frame_info *
0x67, 0x00, 0x00, 0x00, /* movl $SYS_sigreturn, %eax */
0xcd, 0x80 /* int $0x80 */
};
+ size_t buflen = sizeof sigreturn;
char *name, *buf;
/* If the function has a valid symbol name, it isn't a
@@ -79,22 +80,22 @@ i386obsd_sigtramp_p (struct frame_info *
return 0;
/* Allocate buffer. */
- buf = alloca (sizeof sigreturn);
+ buf = alloca (buflen);
/* If we can't read the instructions at START_PC, return zero. */
- if (target_read_memory (start_pc + 0x0a, buf, sizeof sigreturn))
+ if (!safe_frame_unwind_memory (next_frame, start_pc + 0x0a, buf, buflen))
return 0;
/* Check for sigreturn(2). */
- if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
+ if (memcmp (buf, sigreturn, buflen) == 0)
return 1;
/* If we can't read the instructions at START_PC, return zero. */
- if (target_read_memory (start_pc + 0x14, buf, sizeof sigreturn))
+ if (!safe_frame_unwind_memory (next_frame, start_pc + 0x14, buf, buflen))
return 0;
/* Check for sigreturn(2) (again). */
- if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
+ if (memcmp (buf, sigreturn, buflen) == 0)
return 1;
return 0;