From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 607 invoked by alias); 23 May 2009 10:37:29 -0000 Received: (qmail 593 invoked by uid 22791); 23 May 2009 10:37:28 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout5.012.net.il (HELO mtaout5.012.net.il) (84.95.2.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 May 2009 10:37:21 +0000 Received: from conversion-daemon.i_mtaout5.012.net.il by i_mtaout5.012.net.il (HyperSendmail v2004.12) id <0KK300200EOG6O00@i_mtaout5.012.net.il> for gdb-patches@sourceware.org; Sat, 23 May 2009 13:37:18 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.115.215]) by i_mtaout5.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KK30056JEU5BY70@i_mtaout5.012.net.il>; Sat, 23 May 2009 13:37:18 +0300 (IDT) Date: Sat, 23 May 2009 10:37:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Fix printing frame arguments for COFF debug info In-reply-to: <20090521170502.GJ16152@adacore.com> To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83iqjst89t.fsf@gnu.org> References: <83d4a9q9e5.fsf@gnu.org> <20090520213200.GE16152@adacore.com> <837i0bp2bb.fsf@gnu.org> <20090521170502.GJ16152@adacore.com> 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: 2009-05/txt/msg00505.txt.bz2 > Date: Thu, 21 May 2009 10:05:02 -0700 > From: Joel Brobecker > Cc: gdb-patches@sourceware.org > > > > I see that this is addressed in one of your followup messages > > > > Not really, no. The followup messages deal with a different problem. > > This issue, i.e. whether common_val_print and/or val_print should be > > defensive about getting language_auto, still remains. I'd like to > > hear your opinion about that. > > Ah yes, of course! We could add guards in the valprint routines, > I supposed, but I'm not sure it's really worth the effort, now > that we have fixed the cause. The error is not crippling, so > I personally wouldn't bother. But I wouldn't object either, especially > if it's a small localized change (I think I'd make the change in > val_print). How about this: 2009-05-23 Eli Zaretskii * valprint.c (val_print): If LANGUAGE is "unknown" or "auto" or "local", fall back on current_language. --- valprint.c~0 2009-03-21 07:03:53.000000000 +0200 +++ valprint.c 2009-05-23 13:33:14.062500000 +0300 @@ -257,6 +257,14 @@ val_print (struct type *type, const gdb_ return (0); } + /* If the LANGUAGE argument we received is one of the placeholder + ``languages'', its la_val_print method will throw an error. To + avoiding that, try falling back on current_language. */ + if ((language->la_language == language_unknown + || language->la_language == language_auto) + && language->la_language != current_language->la_language) + language = current_language; + TRY_CATCH (except, RETURN_MASK_ERROR) { ret = language->la_val_print (type, valaddr, embedded_offset, address,