diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-01-11 17:18:22 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-01-11 17:18:22 +0000 |
commit | d57df5e4d8db6b79c56666420ec87ed3360c4819 (patch) | |
tree | 6414dcc3cac8bf8c5e3332e21c3ec92d89605923 /gdb | |
parent | dc4503c6810ce9cca69448d2cc0a7804671ffef4 (diff) | |
download | gdb-d57df5e4d8db6b79c56666420ec87ed3360c4819.zip gdb-d57df5e4d8db6b79c56666420ec87ed3360c4819.tar.gz gdb-d57df5e4d8db6b79c56666420ec87ed3360c4819.tar.bz2 |
* frame.c (get_prev_frame_1): Check PC_REGNUM before using it.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/frame.c | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index bda8146..bc417c1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2007-01-11 Daniel Jacobowitz <dan@codesourcery.com> + + * frame.c (get_prev_frame_1): Check PC_REGNUM before using it. + 2007-01-10 Jim Blandy <jimb@codesourcery.com> * MAINTAINERS (Global Maintainers): Ulrich Weigand has accepted diff --git a/gdb/frame.c b/gdb/frame.c index 8d39305..93258d7 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1221,10 +1221,17 @@ get_prev_frame_1 (struct frame_info *this_frame) have different frame IDs, the new frame will be bogus; two functions can't share a register save slot for the PC. This can happen when the prologue analyzer finds a stack adjustment, but - no PC save. This check does assume that the "PC register" is - roughly a traditional PC, even if the gdbarch_unwind_pc method - frobs it. */ + no PC save. + + This check does assume that the "PC register" is roughly a + traditional PC, even if the gdbarch_unwind_pc method adjusts + it (we do not rely on the value, only on the unwound PC being + dependent on this value). A potential improvement would be + to have the frame prev_pc method and the gdbarch unwind_pc + method set the same lval and location information as + frame_register_unwind. */ if (this_frame->level > 0 + && PC_REGNUM >= 0 && get_frame_type (this_frame) == NORMAL_FRAME && get_frame_type (this_frame->next) == NORMAL_FRAME) { |