gdb: remove FIELD_TYPE macro
[deliverable/binutils-gdb.git] / gdb / dwarf2 / macro.c
index 01af58de29f5a05bc9530cdf265b3038dd6e2ba7..d047d806f884b34f97dca2736927413b1f67f9f3 100644 (file)
@@ -231,7 +231,7 @@ static const gdb_byte *
 skip_form_bytes (bfd *abfd, const gdb_byte *bytes, const gdb_byte *buffer_end,
                 enum dwarf_form form,
                 unsigned int offset_size,
-                struct dwarf2_section_info *section)
+                const struct dwarf2_section_info *section)
 {
   unsigned int bytes_read;
 
@@ -322,7 +322,7 @@ skip_unknown_opcode (unsigned int opcode,
                     const gdb_byte *mac_ptr, const gdb_byte *mac_end,
                     bfd *abfd,
                     unsigned int offset_size,
-                    struct dwarf2_section_info *section)
+                    const struct dwarf2_section_info *section)
 {
   unsigned int bytes_read, i;
   unsigned long arg;
@@ -418,18 +418,18 @@ dwarf_parse_macro_header (const gdb_byte **opcode_definitions,
    including DW_MACRO_import.  */
 
 static void
-dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
+dwarf_decode_macro_bytes (dwarf2_per_objfile *per_objfile,
                          buildsym_compunit *builder,
                          bfd *abfd,
                          const gdb_byte *mac_ptr, const gdb_byte *mac_end,
                          struct macro_source_file *current_file,
                          const struct line_header *lh,
-                         struct dwarf2_section_info *section,
+                         const struct dwarf2_section_info *section,
                          int section_is_gnu, int section_is_dwz,
                          unsigned int offset_size,
                          htab_t include_hash)
 {
-  struct objfile *objfile = dwarf2_per_objfile->objfile;
+  struct objfile *objfile = per_objfile->objfile;
   enum dwarf_macro_record_type macinfo_type;
   int at_commandline;
   const gdb_byte *opcode_definitions[256];
@@ -506,15 +506,14 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
                    || macinfo_type == DW_MACRO_undef_sup
                    || section_is_dwz)
                  {
-                   struct dwz_file *dwz
-                     = dwarf2_get_dwz_file (dwarf2_per_objfile);
+                   dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
 
                    body = dwz->read_string (objfile, str_offset);
                  }
                else
-                 body = (dwarf2_per_objfile->str.read_string
-                         (dwarf2_per_objfile->objfile,
-                          str_offset, "DW_FORM_strp"));
+                 body = per_objfile->per_bfd->str.read_string (objfile,
+                                                               str_offset,
+                                                               "DW_FORM_strp");
              }
 
            is_define = (macinfo_type == DW_MACRO_define
@@ -634,7 +633,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
            LONGEST offset;
            void **slot;
            bfd *include_bfd = abfd;
-           struct dwarf2_section_info *include_section = section;
+           const struct dwarf2_section_info *include_section = section;
            const gdb_byte *include_mac_end = mac_end;
            int is_dwz = section_is_dwz;
            const gdb_byte *new_mac_ptr;
@@ -644,7 +643,7 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
 
            if (macinfo_type == DW_MACRO_import_sup)
              {
-               struct dwz_file *dwz = dwarf2_get_dwz_file (dwarf2_per_objfile);
+               dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
 
                dwz->macro.read (objfile);
 
@@ -668,11 +667,11 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
              {
                *slot = (void *) new_mac_ptr;
 
-               dwarf_decode_macro_bytes (dwarf2_per_objfile, builder,
-                                         include_bfd, new_mac_ptr,
-                                         include_mac_end, current_file, lh,
-                                         section, section_is_gnu, is_dwz,
-                                         offset_size, include_hash);
+               dwarf_decode_macro_bytes (per_objfile, builder, include_bfd,
+                                         new_mac_ptr, include_mac_end,
+                                         current_file, lh, section,
+                                         section_is_gnu, is_dwz, offset_size,
+                                         include_hash);
 
                htab_remove_elt (include_hash, (void *) new_mac_ptr);
              }
@@ -709,8 +708,9 @@ dwarf_decode_macro_bytes (struct dwarf2_per_objfile *dwarf2_per_objfile,
 }
 
 void
-dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile,
-                    buildsym_compunit *builder, dwarf2_section_info *section,
+dwarf_decode_macros (dwarf2_per_objfile *per_objfile,
+                    buildsym_compunit *builder,
+                    const dwarf2_section_info *section,
                     const struct line_header *lh, unsigned int offset_size,
                     unsigned int offset, int section_is_gnu)
 {
@@ -859,9 +859,7 @@ dwarf_decode_macros (struct dwarf2_per_objfile *dwarf2_per_objfile,
   mac_ptr = section->buffer + offset;
   slot = htab_find_slot (include_hash.get (), mac_ptr, INSERT);
   *slot = (void *) mac_ptr;
-  dwarf_decode_macro_bytes (dwarf2_per_objfile, builder,
-                           abfd, mac_ptr, mac_end,
-                           current_file, lh, section,
-                           section_is_gnu, 0, offset_size,
-                           include_hash.get ());
+  dwarf_decode_macro_bytes (per_objfile, builder, abfd, mac_ptr, mac_end,
+                           current_file, lh, section, section_is_gnu, 0,
+                           offset_size, include_hash.get ());
 }
This page took 0.02616 seconds and 4 git commands to generate.