diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-09-15 16:09:32 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-09-15 16:09:32 +0000 |
commit | 8285870aeb368fe27af00e8be80261fcda320211 (patch) | |
tree | 7f8f972e3b1bb57df76e94dc6f737f566c342765 /gdb/dwarf2read.c | |
parent | bc426d7a8b915ba9ea9f6abd623aded1de823ac3 (diff) | |
download | gdb-8285870aeb368fe27af00e8be80261fcda320211.zip gdb-8285870aeb368fe27af00e8be80261fcda320211.tar.gz gdb-8285870aeb368fe27af00e8be80261fcda320211.tar.bz2 |
gdb/
Fix gcc-4.5 HEAD warnings for enum ada_operator.
* Makefile.in (HFILES_NO_SRCDIR): Add ada-operator.inc.
* ada-lang.h (enum ada_operator): Move it to ...
* ada-operator.inc: ... a new file.
* expression.h (enum exp_opcode): Include ada-operator.inc.
New element OP_UNUSED_LAST. Update comment for OP_EXTENDED0.
gdb/
Fix gcc-4.5 HEAD warnings for GDB_FORM_cached_string.
* dwarf2read.c (GDB_FORM_cached_string)
(dwarf_form_name <GDB_FORM_cached_string>): Remove.
(struct attribute <dwarf_form>): Reduce the bit width.
(struct attribute <string_is_canonical>, DW_STRING_IS_CANONICAL): New.
(read_attribute_value <DW_FORM_string>)
(read_attribute_value <DW_FORM_strp>): Initialize
DW_STRING_IS_CANONICAL.
(dwarf2_name, dump_die_shallow <DW_FORM_string>)
(dump_die_shallow <DW_FORM_strp>): Update the code using former
GDB_FORM_cached_string.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9be9356..4cce36b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -546,20 +546,17 @@ struct attr_abbrev ENUM_BITFIELD(dwarf_form) form : 16; }; -/* Additional GDB-specific attribute forms. */ -enum - { - /* A string which has been updated to GDB's internal - representation (e.g. converted to canonical form) and does not - need to be updated again. */ - GDB_FORM_cached_string = 0xff - }; - /* Attributes have a name and a value */ struct attribute { ENUM_BITFIELD(dwarf_attribute) name : 16; - ENUM_BITFIELD(dwarf_form) form : 16; + ENUM_BITFIELD(dwarf_form) form : 15; + + /* Has DW_STRING already been updated by dwarf2_canonicalize_name? This + field should be in u.str (existing only for DW_STRING) but it is kept + here for better struct attribute alignment. */ + unsigned int string_is_canonical : 1; + union { char *str; @@ -613,6 +610,7 @@ struct function_range /* Get at parts of an attribute structure */ #define DW_STRING(attr) ((attr)->u.str) +#define DW_STRING_IS_CANONICAL(attr) ((attr)->string_is_canonical) #define DW_UNSND(attr) ((attr)->u.unsnd) #define DW_BLOCK(attr) ((attr)->u.blk) #define DW_SND(attr) ((attr)->u.snd) @@ -7006,11 +7004,13 @@ read_attribute_value (struct attribute *attr, unsigned form, break; case DW_FORM_string: DW_STRING (attr) = read_string (abfd, info_ptr, &bytes_read); + DW_STRING_IS_CANONICAL (attr) = 0; info_ptr += bytes_read; break; case DW_FORM_strp: DW_STRING (attr) = read_indirect_string (abfd, info_ptr, cu_header, &bytes_read); + DW_STRING_IS_CANONICAL (attr) = 0; info_ptr += bytes_read; break; case DW_FORM_block: @@ -9020,12 +9020,12 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu) to canonicalize them. */ return DW_STRING (attr); default: - if (attr->form != GDB_FORM_cached_string) + if (!DW_STRING_IS_CANONICAL (attr)) { DW_STRING (attr) = dwarf2_canonicalize_name (DW_STRING (attr), cu, &cu->objfile->objfile_obstack); - attr->form = GDB_FORM_cached_string; + DW_STRING_IS_CANONICAL (attr) = 1; } return DW_STRING (attr); } @@ -9536,8 +9536,6 @@ dwarf_form_name (unsigned form) return "DW_FORM_flag_present"; case DW_FORM_sig8: return "DW_FORM_sig8"; - case GDB_FORM_cached_string: - return "GDB_FORM_cached_string"; default: return "DW_FORM_<unknown>"; } @@ -10090,10 +10088,10 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) break; case DW_FORM_string: case DW_FORM_strp: - case GDB_FORM_cached_string: - fprintf_unfiltered (f, "string: \"%s\"", + fprintf_unfiltered (f, "string: \"%s\" (%s canonicalized)", DW_STRING (&die->attrs[i]) - ? DW_STRING (&die->attrs[i]) : ""); + ? DW_STRING (&die->attrs[i]) : "", + DW_STRING_IS_CANONICAL (&die->attrs[i]) ? "is" : "not"); break; case DW_FORM_flag: if (DW_UNSND (&die->attrs[i])) |