From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24943 invoked by alias); 20 Jul 2004 22:14:10 -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 24923 invoked from network); 20 Jul 2004 22:14:09 -0000 Received: from unknown (HELO cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com) (81.105.116.12) by sourceware.org with SMTP; 20 Jul 2004 22:14:09 -0000 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com (8.12.11/8.12.11) with ESMTP id i6KMTw0u032001 for ; Tue, 20 Jul 2004 23:29:59 +0100 Subject: Dwarf2 Producer info From: David Lecomber To: patches Content-Type: text/plain Message-Id: <1090362598.21483.108.camel@cpc4-oxfd5-5-0-cust12.oxfd.cable.ntl.com> Mime-Version: 1.0 Date: Tue, 20 Jul 2004 22:14:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-07/txt/msg00268.txt.bz2 Hi This is an obvious extension to plug a gap. I've some more changes to come that make use of this (specifically to take account of broken g77) and also fix some longstanding array issues, but I'm getting this easy one in the source before inflicting the complex one on the world.. if anyone has a sharper eye than me for the code formatting rules, please feel free to shout out! Cheers David 2004-07-20 David Lecomber * dwarf2read.c (set_cu_producer): New. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.156 diff -p -r1.156 dwarf2read.c *** dwarf2read.c 6 Jul 2004 19:29:30 -0000 1.156 --- dwarf2read.c 20 Jul 2004 22:12:07 -0000 *************** struct dwarf2_cu *** 262,267 **** --- 262,269 ---- enum language language; const struct language_defn *language_defn; + const char* producer; + /* The generic symbol table building routines have separate lists for file scope symbols and all all other scopes (local scopes). So we need to select the right one to pass to add_symbol_to_list(). *************** static char *skip_leb128 (bfd *, char *) *** 739,744 **** --- 741,748 ---- static void set_cu_language (unsigned int, struct dwarf2_cu *); + static void set_cu_producer (const char*, struct dwarf2_cu *); + static struct attribute *dwarf2_attr (struct die_info *, unsigned int, struct dwarf2_cu *); *************** read_file_scope (struct die_info *die, s *** 2362,2367 **** --- 2366,2378 ---- set_cu_language (DW_UNSND (attr), cu); } + attr = dwarf2_attr (die, DW_AT_producer, cu); + if (attr) + set_cu_producer (DW_STRING (attr), cu); + else + set_cu_producer(NULL, cu); + + /* We assume that we're processing GCC output. */ processing_gcc_compilation = 2; #if 0 *************** skip_leb128 (bfd *abfd, char *buf) *** 5560,5565 **** --- 5571,5582 ---- } static void + set_cu_producer (const char* producer, struct dwarf2_cu *cu) + { + cu->producer = producer; + } + + static void set_cu_language (unsigned int lang, struct dwarf2_cu *cu) { switch (lang)