summaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2003-12-10 17:40:43 +0000
committerJoel Brobecker <brobecker@gnat.com>2003-12-10 17:40:43 +0000
commit80daa7df6c145bd5e832aee53a8b9969ec342e05 (patch)
tree7a03184befb39cb5a1111df462babc09528b976b /gdb/frame.c
parentcd0d5ff2285456519eb1a6db4f33bd0d0d101b86 (diff)
downloadgdb-80daa7df6c145bd5e832aee53a8b9969ec342e05.tar.gz
* frame.c (select_frame): Get the current frame PC using
get_frame_address_in_block() instead of get_frame_pc(). * stack.c (get_frame_language): Likewise.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 5dc0705a038..1d378913fb4 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -917,7 +917,13 @@ select_frame (struct frame_info *fi)
source language of this frame, and switch to it if desired. */
if (fi)
{
- s = find_pc_symtab (get_frame_pc (fi));
+ /* We retrieve the frame's symtab by using the frame PC. However
+ we cannot use the frame pc as is, because it usually points to
+ the instruction following the "call", which is sometimes the
+ first instruction of another function. So we rely on
+ get_frame_address_in_block() which provides us with a PC which
+ is guaranteed to be inside the frame's code block. */
+ s = find_pc_symtab (get_frame_address_in_block (fi));
if (s
&& s->language != current_language->la_language
&& s->language != language_unknown