Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Interpret DW_TAG_unspecified_type as void
@ 2006-06-09 12:32 Julian Brown
  2006-06-13 23:42 ` Jim Blandy
  2006-06-18  1:16 ` Mark Kettenis
  0 siblings, 2 replies; 5+ messages in thread
From: Julian Brown @ 2006-06-09 12:32 UTC (permalink / raw)
  To: gdb-patches; +Cc: Daniel Jacobowitz, Julian Brown

[-- 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));

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-19 12:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-09 12:32 [PATCH] Interpret DW_TAG_unspecified_type as void Julian Brown
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox