From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28760 invoked by alias); 14 Jul 2010 19:10:10 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 28750 invoked by uid 22791); 14 Jul 2010 19:10:09 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Date: Wed, 14 Jul 2010 19:10:00 -0000 From: Jan Kratochvil To: sami wagiaalla Cc: Project Archer Subject: Re: language setting issue Message-ID: <20100714191000.GA24265@host0.dyn.jankratochvil.net> References: <4C3E0749.2030500@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C3E0749.2030500@redhat.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-SW-Source: 2010-q3/txt/msg00027.txt.bz2 On Wed, 14 Jul 2010 20:51:53 +0200, sami wagiaalla wrote: > ./gdb ./testsuite/gdb.cp/cp-relocate.o -ex 'print func<1>(int)' -ex 'q' > > In this scenario if we check current_language->la_language it will > be set to language_c. > The problem is that current_language is set by checking the extension of the > file of the symbol main which in this case does not exist. It is such only before starting the inferior. Normally select_frame() always sets current_language according to the frame chosen right now. Also in some cases language is passed along structures (such as struct breakpoint) and functions. > To solve this we could just pick an arbitrary objfile and check the > language. This works of we can assume that all files have the same > language. Otherwise we would have to set the language a per block > bases. IMO this problem is only for object files which is mostly just a problem for hackers. And for gdb testsuite. But I agree some better autodetection would be nice. But only for the case of single objfile (and possibly single CU) to make the code simple IMO as it gets never used otherwise anyway. Regards, Jan