From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31442 invoked by alias); 11 Jan 2007 16:05:41 -0000 Received: (qmail 31409 invoked by uid 22791); 11 Jan 2007 16:05:39 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Jan 2007 16:05:32 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id A408448CC0F for ; Thu, 11 Jan 2007 11:04:09 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 17344-01-7 for ; Thu, 11 Jan 2007 11:04:09 -0500 (EST) Received: from takamaka.act-europe.fr (AStDenis-105-1-38-88.w80-8.abo.wanadoo.fr [80.8.139.88]) by nile.gnat.com (Postfix) with ESMTP id AE91148CBE3 for ; Thu, 11 Jan 2007 11:04:08 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 1000) id 2477434C099; Thu, 11 Jan 2007 20:04:58 +0400 (RET) Date: Thu, 11 Jan 2007 16:05:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFA/dwarf2read.c] Make Ada structs "typedef"'ed implicitly Message-ID: <20070111160458.GM23012@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4bRzO86E/ozDv8r1" Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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: 2007-01/txt/msg00299.txt.bz2 --4bRzO86E/ozDv8r1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 784 Hello, This should be the last issue before gdb.ada/null_record.exp starts passing with the Debian Ada compiler. It turned out that the Debian compiler does not generate a DW_TAG_typedef DIE for each struct (aka record in Ada), whereas our does. In Ada, records, unions, and enums are implicitly typedef'ed. The attached patch modifies the sources to reflect this. 2007-01-11 Joel Brobecker * dwarf2read.c (add_partial_symbol): Create an extra partial symbol in the VAR_DOMAIN for Ada structures, unions or enums. (new_symbol): Likewise for symbols. Tested on x86-linux. 1 extra PASS in gdb.ada/null_record.exp, no regression. OK to apply? (many thanks to Daniel for bringing all these issues to my attention) Thanks, -- Joel --4bRzO86E/ozDv8r1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="typedef.diff" Content-length: 1161 Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.210 diff -u -p -r1.210 dwarf2read.c --- dwarf2read.c 5 Jan 2007 05:49:56 -0000 1.210 +++ dwarf2read.c 11 Jan 2007 15:55:36 -0000 @@ -2001,7 +2001,8 @@ add_partial_symbol (struct partial_die_i 0, (CORE_ADDR) 0, cu->language, objfile); if (cu->language == language_cplus - || cu->language == language_java) + || cu->language == language_java + || cu->language == language_ada) { /* For C++ and Java, these implicitly act as typedefs as well. */ add_psymbol_to_list (actual_name, strlen (actual_name), @@ -7170,7 +7171,8 @@ new_symbol (struct die_info *die, struct defines a typedef for the class. Synthesize a typedef symbol so that "ptype foo" works as expected. */ if (cu->language == language_cplus - || cu->language == language_java) + || cu->language == language_java + || cu->language == language_ada) { struct symbol *typedef_sym = (struct symbol *) obstack_alloc (&objfile->objfile_obstack, --4bRzO86E/ozDv8r1--