From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19068 invoked by alias); 21 May 2008 16:45:19 -0000 Received: (qmail 19057 invoked by uid 22791); 21 May 2008 16:45:16 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 May 2008 16:44:57 +0000 Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 519DB463C5 for ; Wed, 21 May 2008 18:44:54 +0200 (CEST) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: Avoid decode_objc clobbering current language X-Yow: Let's all show human CONCERN for REVEREND MOON's legal difficulties!! Date: Wed, 21 May 2008 19:38:00 -0000 Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00639.txt.bz2 This fixes the failure in gdb.ada/frame_args.exp: (gdb) break break_me Breakpoint 1 at 0x10001170: file /cvs/gdb/gdb/testsuite/gdb.ada/frame_args/pck.adb, line 21. (gdb) run Starting program: /sykes/cvs/test/ppc/gdb/gdb/testsuite/gdb.ada/frame_args/foo Error in re-setting breakpoint 1: Function "break_me" not defined. Program exited normally. (gdb) FAIL: gdb.ada/frame_args.exp: running to break_me in runto The problem is that sal_decode_line_1 (here called from breakpoint_re_set_one) calls decode_objc, which indirectly calls get_selected_frame. Since the program is just being started there is no selected frame yet, thus get_selected_frame called select_frame, which re-sets current_language (typically to language_c). Thus the set_language call in breakpoint_re_set_one is useless. Andreas. 2008-05-21 Andreas Schwab * linespec.c (decode_objc): Save current language around call to get_selected_block. --- gdb/linespec.c.~1.79.~ 2008-05-20 10:58:04.000000000 +0200 +++ gdb/linespec.c 2008-05-21 18:17:04.000000000 +0200 @@ -1116,8 +1116,16 @@ decode_objc (char **argptr, int funfirst if (file_symtab != NULL) block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_symtab), STATIC_BLOCK); else - block = get_selected_block (0); - + { + enum language save_language; + + /* get_selected_block can change the current language when there is + no selected frame yet. */ + save_language = current_language->la_language; + block = get_selected_block (0); + set_language (save_language); + } + copy = find_imps (file_symtab, block, *argptr, NULL, &i1, &i2); if (i1 > 0) -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."