aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.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
commit7ae4c3a566beba00e16dd10bb69414ffc214dcbb (patch)
tree6ced00fb4dfffef4e991d205938aa202a1e9483f /gdb/stack.c
parent4249f881bdb61da1be3dc569c5920507a058c3f7 (diff)
downloadfsf-binutils-gdb-7ae4c3a566beba00e16dd10bb69414ffc214dcbb.zip
fsf-binutils-gdb-7ae4c3a566beba00e16dd10bb69414ffc214dcbb.tar.gz
fsf-binutils-gdb-7ae4c3a566beba00e16dd10bb69414ffc214dcbb.tar.bz2
* 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/stack.c')
-rw-r--r--gdb/stack.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 04e6a18..a2b331f 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2036,7 +2036,14 @@ get_frame_language (void)
if (deprecated_selected_frame)
{
- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
+ /* We determine the current frame language by looking up its
+ associated symtab. To retrieve this symtab, we use 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(), it 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 (deprecated_selected_frame));
if (s)
flang = s->language;
else