From: Julian Brown <julian@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <dan@codesourcery.com>,
Julian Brown <julian@codesourcery.com>
Subject: [PATCH] Interpret DW_TAG_unspecified_type as void
Date: Fri, 09 Jun 2006 12:32:00 -0000 [thread overview]
Message-ID: <448969B2.9010202@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 841 bytes --]
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.
[-- Attachment #2: unspecified-type-void.patch --]
[-- Type: text/x-patch, Size: 1186 bytes --]
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));
next reply other threads:[~2006-06-09 12:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 12:32 Julian Brown [this message]
2006-06-13 23:42 ` Jim Blandy
2006-06-13 23:47 ` Daniel Jacobowitz
2006-06-18 1:16 ` Mark Kettenis
2006-06-19 12:58 ` Richard Earnshaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=448969B2.9010202@codesourcery.com \
--to=julian@codesourcery.com \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox