diff options
author | Joel Brobecker <brobecker@gnat.com> | 2008-06-26 19:08:10 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2008-06-26 19:08:10 +0000 |
commit | 28e9494986fe5b016812da397090f2244ea23055 (patch) | |
tree | 4d39c5d87d37daff7c773aa4e1367f09f151b6c7 | |
parent | 8a77dff3224bd60c1adbaa3fd5b30ae1cfe2ae42 (diff) | |
download | gdb-28e9494986fe5b016812da397090f2244ea23055.zip gdb-28e9494986fe5b016812da397090f2244ea23055.tar.gz gdb-28e9494986fe5b016812da397090f2244ea23055.tar.bz2 |
* dwarf2read.c (read_attribute_value): Treat size attribute
values of 0xffffffff as if the attribute value was zero.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d5957ec..e13a47a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-06-26 Joel Brobecker <brobecker@adacore.com> + + * dwarf2read.c (read_attribute_value): Treat size attribute + values of 0xffffffff as if the attribute value was zero. + 2008-06-26 Vladimir Prus <vladimir@codesourcery.com> * linux-nat.c: Add description of overall logic. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e36177a..9723ddd 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -6234,6 +6234,18 @@ read_attribute_value (struct attribute *attr, unsigned form, dwarf_form_name (form), bfd_get_filename (abfd)); } + + /* We have seen instances where the compiler tried to emit a byte + size attribute of -1 which ended up being encoded as an unsigned + 0xffffffff. Although 0xffffffff is technically a valid size value, + an object of this size seems pretty unlikely so we can relatively + safely treat these cases as if the size attribute was invalid and + treat them as zero by default. */ + if (attr->name == DW_AT_byte_size + && form == DW_FORM_data4 + && DW_UNSND (attr) >= 0xffffffff) + DW_UNSND (attr) = 0; + return info_ptr; } |