diff options
author | Gaius Mulley <gaius@glam.ac.uk> | 2006-05-13 15:46:38 +0000 |
---|---|---|
committer | Gaius Mulley <gaius@glam.ac.uk> | 2006-05-13 15:46:38 +0000 |
commit | 72019c9cbc1405cb0ecfab5d57a66279a45c19c5 (patch) | |
tree | 3a0de2f116ae273c53484e3d28af93cd339e2b95 /gdb/dwarf2read.c | |
parent | 34addd0f72d6ef37bf70f8772509495cd2d733a8 (diff) | |
download | gdb-72019c9cbc1405cb0ecfab5d57a66279a45c19c5.zip gdb-72019c9cbc1405cb0ecfab5d57a66279a45c19c5.tar.gz gdb-72019c9cbc1405cb0ecfab5d57a66279a45c19c5.tar.bz2 |
2006-05-13 Gaius Mulley <gaius@glam.ac.uk>
* gdb/m2-lang.h: added function extern prototypes for m2_is_long_set
and get_long_set_bounds.
* gm2/m2-typeprint.c: This file has been completely
replaced to reflect the Modula-2 syntax rather than call the
c_print_type function.
(m2_print_type): walk the Modula-2 type tree.
(m2_type_name): added.
(m2_range): added.
(m2_typedef): added.
(m2_array): added.
(m2_pointer): added.
(m2_ref): added.
(m2_unknown): added.
(m2_union): added.
(m2_procedure): added.
(m2_print_bounds): added.
(m2_short_set): added.
(m2_is_long_set): added.
(m2_get_discrete_bounds): added.
(m2_is_long_set_of_type): added.
(m2_long_set): added.
(m2_record_fields): added.
(m2_enum): added.
* gdb/dwarf2read.c: added ability to detect the language Modula-2
and handle SET and CHAR types.
(read_set_type): added.
(process_die): call read_set_type.
(read_base_type): modifed signed/unsigned char handling for Modula-2.
(set_cu_language): added Modula-2 case clause.
* gdb/m2-valprint.c: complete replacement so that Modula-2 values are
printed rather than call the C language routines.
(print_function_pointer_address): added.
(get_long_set_bounds): added.
(m2_print_long_set): added.
(print_unpacked_pointer): added.
(print_variable_at_address): added.
(m2_val_print): replaced.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0881e3d..31b0ae0 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1,7 +1,7 @@ /* DWARF 2 debugging format support for GDB. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology, @@ -1073,6 +1073,9 @@ static void dwarf2_mark (struct dwarf2_cu *); static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); +static void read_set_type (struct die_info *, struct dwarf2_cu *); + + /* Try to locate the sections we need for DWARF 2 debugging information and return true if we have enough to do something. */ @@ -2662,6 +2665,9 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_subroutine_type: read_subroutine_type (die, cu); break; + case DW_TAG_set_type: + read_set_type (die, cu); + break; case DW_TAG_array_type: read_array_type (die, cu); break; @@ -4240,6 +4246,15 @@ read_array_order (struct die_info *die, struct dwarf2_cu *cu) }; } +/* Extract all information from a DW_TAG_set_type DIE and put it in + the DIE's type field. */ + +static void +read_set_type (struct die_info *die, struct dwarf2_cu *cu) +{ + if (die->type == NULL) + die->type = create_set_type ((struct type *) NULL, die_type (die, cu)); +} /* First cut: install each common block member as a global variable. */ @@ -4728,10 +4743,17 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) code = TYPE_CODE_FLT; break; case DW_ATE_signed: - case DW_ATE_signed_char: break; case DW_ATE_unsigned: - case DW_ATE_unsigned_char: + type_flags |= TYPE_FLAG_UNSIGNED; + break; + case DW_ATE_signed_char: + if (cu->language == language_m2) + code = TYPE_CODE_CHAR; + break; + case DW_ATE_unsigned_char: + if (cu->language == language_m2) + code = TYPE_CODE_CHAR; type_flags |= TYPE_FLAG_UNSIGNED; break; default: @@ -6168,10 +6190,12 @@ set_cu_language (unsigned int lang, struct dwarf2_cu *cu) case DW_LANG_Ada95: cu->language = language_ada; break; + case DW_LANG_Modula2: + cu->language = language_m2; + break; case DW_LANG_Cobol74: case DW_LANG_Cobol85: case DW_LANG_Pascal83: - case DW_LANG_Modula2: default: cu->language = language_minimal; break; @@ -6961,6 +6985,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) case DW_TAG_class_type: case DW_TAG_structure_type: case DW_TAG_union_type: + case DW_TAG_set_type: case DW_TAG_enumeration_type: SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; @@ -7290,6 +7315,9 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_array_type: read_array_type (die, cu); break; + case DW_TAG_set_type: + read_set_type (die, cu); + break; case DW_TAG_pointer_type: read_tag_pointer_type (die, cu); break; |