From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org, Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [RFA/RFC/dwarf] detect 0xffffffff size attribute values
Date: Thu, 26 Jun 2008 20:11:00 -0000 [thread overview]
Message-ID: <20080626193419.GB3586@adacore.com> (raw)
In-Reply-To: <20080626134046.GC22726@caradoc.them.org>
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
Hi Daniel,
> > 2008-06-19 Joel Brobecker <brobecker@adacore.com>
> >
> > * dwarf2read.c (read_attribute_value): Treat size attribute
> > values of 0xffffffff as if the attribute value was zero.
>
> OK. A complaint when this happens wouldn't be a bad thing, either.
Thanks for the review. I am not 100% sure about the complaint, because
I presume that this issue happens on a routine basis whenever record
types (the equivalent of structs) whose size is dynamic are used.
If they are frequent, my concern is that the complaint mechanism would
be shut down by several repetitions of the same complaint before giving
other complaints a chance to print their message? Perhaps we could
decide to define a new complaint category, instead of using the symtab
category? In the meantime, I checked the initial patch in, and started
testing the following patch:
2008-06-26 Joel Brobecker <brobecker@adacore.com>
* dwarf2read.c (read_attribute_value): Issue a complaint when
adjusting size attribute values of 0xffffffff as zero.
WDYT?
--
Joel
[-- Attachment #2: dwarf-complaint.diff --]
[-- Type: text/plain, Size: 705 bytes --]
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.266
diff -u -p -r1.266 dwarf2read.c
--- dwarf2read.c 26 Jun 2008 19:08:10 -0000 1.266
+++ dwarf2read.c 26 Jun 2008 19:25:09 -0000
@@ -6244,7 +6244,13 @@ read_attribute_value (struct attribute *
if (attr->name == DW_AT_byte_size
&& form == DW_FORM_data4
&& DW_UNSND (attr) >= 0xffffffff)
- DW_UNSND (attr) = 0;
+ {
+ complaint
+ (&symfile_complaints,
+ _("Suspicious DW_AT_byte_size value treated as zero instead of %lx"),
+ DW_UNSND (attr));
+ DW_UNSND (attr) = 0;
+ }
return info_ptr;
}
next prev parent reply other threads:[~2008-06-26 19:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-19 3:58 Joel Brobecker
2008-06-19 13:56 ` Jan Kratochvil
2008-06-26 13:45 ` Daniel Jacobowitz
2008-06-26 20:11 ` Joel Brobecker [this message]
2008-06-26 20:19 ` Daniel Jacobowitz
2008-06-26 23:26 ` Joel Brobecker
2008-06-27 0:15 ` Daniel Jacobowitz
2008-06-27 18:20 ` Joel Brobecker
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=20080626193419.GB3586@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/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