summaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2007-01-11 17:18:22 +0000
committerDaniel Jacobowitz <dan@debian.org>2007-01-11 17:18:22 +0000
commitad47b8f30006e4f196eaadcf546237c7f6ee79e9 (patch)
treed7786a71d1065d0ddd38e796d7c68c54d1f47ed6 /gdb/frame.c
parent94ec833c07a82e71d54ca05c6a2ad0f0a9bbe492 (diff)
downloadgdb-ad47b8f30006e4f196eaadcf546237c7f6ee79e9.tar.gz
* frame.c (get_prev_frame_1): Check PC_REGNUM before using it.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 8d393050c68..93258d7720e 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)
{