aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386obsd-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-08-06 20:51:01 +0000
committerMark Kettenis <kettenis@gnu.org>2004-08-06 20:51:01 +0000
commitc822af0c707258b74054d5e3bf3f8857ee32191d (patch)
treee0aa4d0dba9da98a985b768fbb10832864da6fb6 /gdb/i386obsd-tdep.c
parentc0ccb908a0d28944b8715c2d229ee55e8cdace59 (diff)
downloadgdb-c822af0c707258b74054d5e3bf3f8857ee32191d.zip
gdb-c822af0c707258b74054d5e3bf3f8857ee32191d.tar.gz
gdb-c822af0c707258b74054d5e3bf3f8857ee32191d.tar.bz2
* i386obsd-tdep.c (i386obsd_sigtramp_p): Use
safe_frame_unwind_memory instead of target_read_memory.
Diffstat (limited to 'gdb/i386obsd-tdep.c')
-rw-r--r--gdb/i386obsd-tdep.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index b2c803f..9ef868d 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -65,6 +65,7 @@ i386obsd_sigtramp_p (struct frame_info *next_frame)
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 *next_frame)
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;