From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29563 invoked by alias); 9 Jun 2006 12:32:00 -0000 Received: (qmail 29546 invoked by uid 22791); 9 Jun 2006 12:32:00 -0000 X-Spam-Check-By: sourceware.org Received: from intranet.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.6) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Jun 2006 12:31:57 +0000 Received: (qmail 26577 invoked from network); 9 Jun 2006 12:29:47 -0000 Received: from unknown (HELO ?10.1.1.7?) (julian@127.0.0.2) by mail.codesourcery.com with ESMTPA; 9 Jun 2006 12:29:47 -0000 Message-ID: <448969B2.9010202@codesourcery.com> Date: Fri, 09 Jun 2006 12:32:00 -0000 From: Julian Brown User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: Daniel Jacobowitz , Julian Brown Subject: [PATCH] Interpret DW_TAG_unspecified_type as void Content-Type: multipart/mixed; boundary="------------070100010305000106030606" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00091.txt.bz2 This is a multi-part message in MIME format. --------------070100010305000106030606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 841 Hi, This is part of a series of patches from a CodeSourcery branch which enable the output of ARM's RVCT 2.2 compiler to be debugged with gdb. This patch handles the C/C++ interpretation of the DWARF 3 construct DW_TAG_unspecified_type as void. This is used in representing e.g. pointer-to-void types. Other languages will currently be handled in exactly the same way; though I'm not entirely sure if that's a sensible default, I don't know what would be better. (Re: section 5.2 of the DWARF 3 doc.) Tested natively on x86_64-unknown-linux-gnu and cross to arm-none-eabi with no change in results. Tests against the ARM compiler are improved somewhat. OK to apply? Cheers, Julian ChangeLog (Daniel Jacobowitz): * dwarf2read.c (read_unspecified_type): New function. (read_type_die): Handle DW_TAG_unspecified_type. --------------070100010305000106030606 Content-Type: text/x-patch; name="unspecified-type-void.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="unspecified-type-void.patch" Content-length: 1186 Index: src/gdb/dwarf2read.c =================================================================== --- src.orig/gdb/dwarf2read.c 2005-03-07 06:00:16.000000000 -0800 +++ src/gdb/dwarf2read.c 2005-03-07 07:27:38.000000000 -0800 @@ -4992,6 +4992,23 @@ read_subrange_type (struct die_info *die set_die_type (die, range_type, cu); } +static void +read_unspecified_type (struct die_info *die, struct dwarf2_cu *cu) +{ + struct type *type; + struct attribute *attr; + + if (die->type) + return; + + /* For now, we only support the C meaning of an unspecified type: void. */ + + attr = dwarf2_attr (die, DW_AT_name, cu); + type = init_type (TYPE_CODE_VOID, 0, 0, attr ? DW_STRING (attr) : "", + cu->objfile); + + set_die_type (die, type, cu); +} /* Read a whole compilation unit into a linked list of dies. */ @@ -7526,6 +7543,9 @@ read_type_die (struct die_info *die, str case DW_TAG_base_type: read_base_type (die, cu); break; + case DW_TAG_unspecified_type: + read_unspecified_type (die, cu); + break; default: complaint (&symfile_complaints, _("unexepected tag in read_type_die: '%s'"), dwarf_tag_name (die->tag)); --------------070100010305000106030606--