Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA] handle DW_AT_byte_size for set types
Date: Mon, 17 May 2010 15:47:00 -0000	[thread overview]
Message-ID: <000301caf5d7$ab26f030$0174d090$@muller@ics-cnrs.unistra.fr> (raw)

  According to Dwarf 2.0.0 page 46,
DW_TAG_set_type
supports DW_AT_byte_size attribute,
but this is not implemented yet inside GDB.

  The patch below implements this,
it will allow to correctly give the value of 
constant pascal sets (at least for Free Pascal compiler).

  The patch is rather obvious...
Is this OK?

Pierre Muller
Pascal language support maintainer for GDB


 
2010-05-17  Pierre Muller  <muller@ics.u-strasbg.fr>

	* dwarf2read.c (read_set_type): Set type length if
	DW_AT_byte_size attribute is present.

Index: src/gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.385
diff -u -p -r1.385 dwarf2read.c
--- src/gdb/dwarf2read.c	14 May 2010 17:53:16 -0000	1.385
+++ src/gdb/dwarf2read.c	17 May 2010 15:33:17 -0000
@@ -5547,7 +5556,10 @@ static struct type *
 read_set_type (struct die_info *die, struct dwarf2_cu *cu)
 {
   struct type *set_type = create_set_type (NULL, die_type (die, cu));
+  struct attribute *attr = dwarf2_attr (die, DW_AT_byte_size, cu);
 
+  if (attr)
+    TYPE_LENGTH(set_type) = DW_UNSND (attr);
   return set_die_type (die, set_type, cu);
 }
 



             reply	other threads:[~2010-05-17 15:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17 15:47 Pierre Muller [this message]
2010-05-17 15:47 ` Joel Brobecker
2010-05-17 16:07   ` Pierre Muller
     [not found] <41574.4677339264$1274111006@news.gmane.org>
2010-05-17 15:57 ` Tom Tromey

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='000301caf5d7$ab26f030$0174d090$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --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