[RFC] Unexpected automatic language switch - get_frame_language()

Joel Brobecker brobecker@gnat.com
Wed Dec 10 01:50:00 GMT 2003


> Looked at frame_addr_in_block?

That's (almost) the function I was trying to remember about. Thanks a
lot!  The following patch addresses the problem in a way that I hope
will satisfy MichaelS' concerns.

2003-12-09  J. Brobecker  <brobecker@gnat.com>

        * 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.

Tested on x86-linux, with no regression.

OK to apply?

Thanks,
-- 
Joel
-------------- next part --------------
Index: frame.c
===================================================================
RCS file: /nile.c/cvs/Dev/gdb/gdb-6.0/gdb/frame.c,v
retrieving revision 1.2
diff -u -p -r1.2 frame.c
--- frame.c	6 Oct 2003 05:20:55 -0000	1.2
+++ frame.c	9 Dec 2003 00:19:00 -0000
@@ -985,7 +985,7 @@ 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));
+      s = find_pc_symtab (get_frame_address_in_block (fi));
       if (s
 	  && s->language != current_language->la_language
 	  && s->language != language_unknown
Index: stack.c
===================================================================
RCS file: /nile.c/cvs/Dev/gdb/gdb-6.0/gdb/stack.c,v
retrieving revision 1.3
diff -u -p -r1.3 stack.c
--- stack.c	13 Nov 2003 11:56:27 -0000	1.3
+++ stack.c	9 Dec 2003 00:20:14 -0000
@@ -2047,7 +2047,7 @@ get_frame_language (void)
 
   if (deprecated_selected_frame)
     {
-      s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
+      s = find_pc_symtab (get_frame_address_in_block (deprecated_selected_frame));
       if (s)
 	flang = s->language;
       else


More information about the Gdb-patches mailing list