From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16361 invoked by alias); 10 Dec 2003 01:50:57 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16165 invoked from network); 10 Dec 2003 01:50:55 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (205.232.38.116) by sources.redhat.com with SMTP; 10 Dec 2003 01:50:55 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 1D58347D62; Tue, 9 Dec 2003 20:50:55 -0500 (EST) Date: Wed, 10 Dec 2003 01:50:00 -0000 From: Joel Brobecker To: Andrew Cagney Cc: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [RFC] Unexpected automatic language switch - get_frame_language() Message-ID: <20031210015055.GB842@gnat.com> References: <20031205224807.GE716@gnat.com> <3FD11B60.2040008@redhat.com> <20031206001815.GF716@gnat.com> <3FD12296.8090809@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+" Content-Disposition: inline In-Reply-To: <3FD12296.8090809@gnu.org> User-Agent: Mutt/1.4i X-SW-Source: 2003-12/txt/msg00283.txt.bz2 --NMuMz9nt05w80d4+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 508 > 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 * 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 --NMuMz9nt05w80d4+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="addr_in_block.diff" Content-length: 1180 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 --NMuMz9nt05w80d4+--