diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2001-12-19 23:54:27 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2001-12-19 23:54:27 +0000 |
commit | 16a0f3e75ec06dd9d4ff578c2ae5273c364f165c (patch) | |
tree | 76bf6c3dc271a1e5a6b541049b927b39124ac562 /gdb/arm-tdep.c | |
parent | 47a70901841dedf5a3067a6798e29da42fb14fbe (diff) | |
download | gdb-16a0f3e75ec06dd9d4ff578c2ae5273c364f165c.zip gdb-16a0f3e75ec06dd9d4ff578c2ae5273c364f165c.tar.gz gdb-16a0f3e75ec06dd9d4ff578c2ae5273c364f165c.tar.bz2 |
2001-12-19 Elena Zannoni <ezannoni@redhat.com>
* corefile.c (do_captured_read_memory_integer,
safe_read_memory_integer): New functions.
* gdbcore.h (safe_read_memory_integer): Export.
* arm-tdep.c (arm_scan_prologue): Use safe_read_memory_integer,
to read the frame value, to capture calls to error().
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r-- | gdb/arm-tdep.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 434b26f..d3e8b94 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -727,6 +727,7 @@ static void arm_scan_prologue (struct frame_info *fi) { int regno, sp_offset, fp_offset; + LONGEST return_value; CORE_ADDR prologue_start, prologue_end, current_pc; /* Check if this function is already in the cache of frame information. */ @@ -791,9 +792,13 @@ arm_scan_prologue (struct frame_info *fi) { /* Get address of the stmfd in the prologue of the callee; the saved PC is the address of the stmfd + 8. */ - prologue_start = ADDR_BITS_REMOVE (read_memory_integer (fi->frame, 4)) - - 8; - prologue_end = prologue_start + 64; /* See above. */ + if (!safe_read_memory_integer (fi->frame, 4, &return_value)) + return; + else + { + prologue_start = ADDR_BITS_REMOVE (return_value) - 8; + prologue_end = prologue_start + 64; /* See above. */ + } } /* Now search the prologue looking for instructions that set up the |