From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5035 invoked by alias); 16 May 2009 18:00:12 -0000 Received: (qmail 4999 invoked by uid 22791); 16 May 2009 18:00:10 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout7.012.net.il (HELO mtaout7.012.net.il) (84.95.2.19) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 May 2009 18:00:00 +0000 Received: from conversion-daemon.i-mtaout7.012.net.il by i-mtaout7.012.net.il (HyperSendmail v2007.08) id <0KJR005000KL7600@i-mtaout7.012.net.il> for gdb-patches@sourceware.org; Sat, 16 May 2009 20:59:49 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.73.80]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KJR00L950NO3IC0@i-mtaout7.012.net.il>; Sat, 16 May 2009 20:59:49 +0300 (IDT) Date: Sat, 16 May 2009 18:00:00 -0000 From: Eli Zaretskii Subject: More problems with language in printing symbols In-reply-to: <83d4a9q9e5.fsf@gnu.org> To: Eli Zaretskii Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83ab5dq67f.fsf@gnu.org> References: <83d4a9q9e5.fsf@gnu.org> 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/msg00341.txt.bz2 There's a similar, but different problem with printing symbols in "maint print symbols". When the program is compiled with COFF debug info, "maint print symbols" throws an error for some symbols: Error printing symbol: internal error - unimplemented function unk_lang_print_type called. This happens because of this change: 2005-06-03 Joel Brobecker * symmisc.c (dump_symtab_1): Renamed from dump_symtab. (dump_symtab): New function. The new dump_symtab does this: /* Set the current language to the language of the symtab we're dumping because certain routines used during dump_symtab() use the current language to print an image of the symbol. We'll restore it later. */ saved_lang = set_language (symtab->language); dump_symtab_1 (objfile, symtab, outfile); set_language (saved_lang); However, it does not check what is the value of symtab->language. It so happens that coffread.c creates a symtab for a "_globals_" pseudo-file, whose symtab gets its language set to language_unknown, because deduce_language_from_filename does not recognize such a file name. And, of course, trying to print symbols with language_unknown as the current language does not give good results... I'm unsure how best to fix that. We could try recognizing "_globals_" in deduce_language_from_filename, but what language to use for it? Or we could add some defensive fallback in dump_symtab which would not switch the language if it is language_unknown. Comments? ideas?