gdb: Rename structures within ctfread.c
[deliverable/binutils-gdb.git] / gdb / xcoffread.c
index 215645d6e1192de80ca81bc690a536d4040a2bea..aec19237214a1598195d0a9b2d18adb62fba9a6c 100644 (file)
@@ -267,9 +267,9 @@ find_targ_sec (bfd *abfd, asection *sect, void *obj)
   if (sect->target_index == args->targ_index)
     {
       /* This is the section.  Figure out what SECT_OFF_* code it is.  */
-      if (bfd_get_section_flags (abfd, sect) & SEC_CODE)
+      if (bfd_section_flags (sect) & SEC_CODE)
        *args->resultp = SECT_OFF_TEXT (objfile);
-      else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
+      else if (bfd_section_flags (sect) & SEC_LOAD)
        *args->resultp = SECT_OFF_DATA (objfile);
       else
        *args->resultp = gdb_bfd_section_index (abfd, sect);
@@ -1045,7 +1045,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
   pst_symtab_language = deduce_language_from_filename (filestring);
 
   start_stabs ();
-  start_symtab (objfile, filestring, (char *) NULL, file_start_addr,
+  start_symtab (objfile, filestring, NULL, file_start_addr,
                pst_symtab_language);
   record_debugformat (debugfmt);
   symnum = ((struct symloc *) pst->read_symtab_private)->first_symnum;
@@ -1139,8 +1139,8 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
            }
 
          start_stabs ();
-         start_symtab (objfile, "_globals_", (char *) NULL,
-                       (CORE_ADDR) 0, pst_symtab_language);
+         start_symtab (objfile, "_globals_", NULL,
+                       0, pst_symtab_language);
          record_debugformat (debugfmt);
          cur_src_end_addr = first_object_file_end;
          /* Done with all files, everything from here on is globals.  */
@@ -1230,7 +1230,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
                          /* Give all csects for this source file the same
                             name.  */
                          start_symtab (objfile, filestring, NULL,
-                                       (CORE_ADDR) 0, pst_symtab_language);
+                                       0, pst_symtab_language);
                          record_debugformat (debugfmt);
                        }
 
@@ -1350,8 +1350,7 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
            filestring = cs->c_name;
 
          start_stabs ();
-         start_symtab (objfile, filestring, (char *) NULL, (CORE_ADDR) 0,
-                       pst_symtab_language);
+         start_symtab (objfile, filestring, NULL, 0, pst_symtab_language);
          record_debugformat (debugfmt);
          last_csect_name = 0;
 
@@ -1540,8 +1539,8 @@ read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
 
 
 #define        SYMNAME_ALLOC(NAME, ALLOCED)    \
-  ((ALLOCED) ? (NAME) : obstack_copy0 (&objfile->objfile_obstack, \
-                                      (NAME), strlen (NAME)))
+  ((ALLOCED) ? (NAME) : obstack_strdup (&objfile->objfile_obstack, \
+                                       (NAME)))
 
 
 /* process one xcoff symbol.  */
@@ -1577,7 +1576,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
   initialize_objfile_symbol (sym);
 
   /* default assumptions */
-  SYMBOL_VALUE_ADDRESS (sym) = cs->c_value + off;
+  SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off);
   SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
   SYMBOL_SECTION (sym) = secnum_to_section (cs->c_secnum, objfile);
 
@@ -1587,8 +1586,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
          will be patched with the type from its stab entry later on in
          patch_block_stabs (), unless the file was compiled without -g.  */
 
-      SYMBOL_SET_LINKAGE_NAME (sym, ((const char *)
-                                    SYMNAME_ALLOC (name, symname_alloced)));
+      SYMBOL_SET_LINKAGE_NAME (sym, SYMNAME_ALLOC (name, symname_alloced));
       SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
 
       SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
@@ -1676,7 +1674,9 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
                               cs->c_name, 0, 0, objfile);
          if (sym != NULL)
            {
-             SYMBOL_VALUE_ADDRESS (sym) += static_block_base;
+             SET_SYMBOL_VALUE_ADDRESS (sym,
+                                       SYMBOL_VALUE_ADDRESS (sym)
+                                       + static_block_base);
              SYMBOL_SECTION (sym) = static_block_section;
            }
          return sym;
@@ -2356,7 +2356,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                       section.  */
                    bfd_sect = secnum_to_bfd_section (symbol.n_scnum, objfile);
                    if (bfd_sect)
-                     toc_offset -= bfd_section_vma (objfile->obfd, bfd_sect);
+                     toc_offset -= bfd_section_vma (bfd_sect);
                    break;
 
                  case XMC_TC:
@@ -2646,7 +2646,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                  namestring = gdbarch_static_transform_name
                                 (gdbarch, namestring);
 
-               add_psymbol_to_list (namestring, p - namestring, 1,
+               add_psymbol_to_list (namestring, p - namestring, true,
                                     VAR_DOMAIN, LOC_STATIC,
                                     SECT_OFF_DATA (objfile),
                                     psymbol_placement::STATIC,
@@ -2657,7 +2657,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
              case 'G':
                /* The addresses in these entries are reported to be
                   wrong.  See the code that reads 'G's for symtabs.  */
-               add_psymbol_to_list (namestring, p - namestring, 1,
+               add_psymbol_to_list (namestring, p - namestring, true,
                                     VAR_DOMAIN, LOC_STATIC,
                                     SECT_OFF_DATA (objfile),
                                     psymbol_placement::GLOBAL,
@@ -2676,14 +2676,14 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                    || (p == namestring + 1
                        && namestring[0] != ' '))
                  {
-                   add_psymbol_to_list (namestring, p - namestring, 1,
+                   add_psymbol_to_list (namestring, p - namestring, true,
                                         STRUCT_DOMAIN, LOC_TYPEDEF, -1,
                                         psymbol_placement::STATIC,
                                         0, psymtab_language, objfile);
                    if (p[2] == 't')
                      {
                        /* Also a typedef with the same name.  */
-                       add_psymbol_to_list (namestring, p - namestring, 1,
+                       add_psymbol_to_list (namestring, p - namestring, true,
                                             VAR_DOMAIN, LOC_TYPEDEF, -1,
                                             psymbol_placement::STATIC,
                                             0, psymtab_language, objfile);
@@ -2695,7 +2695,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
              case 't':
                if (p != namestring)    /* a name is there, not just :T...  */
                  {
-                   add_psymbol_to_list (namestring, p - namestring, 1,
+                   add_psymbol_to_list (namestring, p - namestring, true,
                                         VAR_DOMAIN, LOC_TYPEDEF, -1,
                                         psymbol_placement::STATIC,
                                         0, psymtab_language, objfile);
@@ -2757,7 +2757,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                          ;
                        /* Note that the value doesn't matter for
                           enum constants in psymtabs, just in symtabs.  */
-                       add_psymbol_to_list (p, q - p, 1,
+                       add_psymbol_to_list (p, q - p, true,
                                             VAR_DOMAIN, LOC_CONST, -1,
                                             psymbol_placement::STATIC,
                                             0, psymtab_language, objfile);
@@ -2775,7 +2775,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
 
              case 'c':
                /* Constant, e.g. from "const" in Pascal.  */
-               add_psymbol_to_list (namestring, p - namestring, 1,
+               add_psymbol_to_list (namestring, p - namestring, true,
                                     VAR_DOMAIN, LOC_CONST, -1,
                                     psymbol_placement::STATIC,
                                     0, psymtab_language, objfile);
@@ -2792,7 +2792,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                    function_outside_compilation_unit_complaint (name);
                    xfree (name);
                  }
-               add_psymbol_to_list (namestring, p - namestring, 1,
+               add_psymbol_to_list (namestring, p - namestring, true,
                                     VAR_DOMAIN, LOC_BLOCK,
                                     SECT_OFF_TEXT (objfile),
                                     psymbol_placement::STATIC,
@@ -2822,7 +2822,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
                if (startswith (namestring, "@FIX"))
                  continue;
 
-               add_psymbol_to_list (namestring, p - namestring, 1,
+               add_psymbol_to_list (namestring, p - namestring, true,
                                     VAR_DOMAIN, LOC_BLOCK,
                                     SECT_OFF_TEXT (objfile),
                                     psymbol_placement::GLOBAL,
@@ -2954,7 +2954,7 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags)
          secp = bfd_get_section_by_name (abfd, ".debug");
          if (secp)
            {
-             length = bfd_section_size (abfd, secp);
+             length = bfd_section_size (secp);
              if (length)
                {
                  debugsec
@@ -3031,8 +3031,7 @@ xcoff_symfile_offsets (struct objfile *objfile,
   if (objfile->num_sections == 0)
     return; /* Is that even possible?  Better safe than sorry.  */
 
-  first_section_name
-    = bfd_section_name (objfile->obfd, objfile->sections[0].the_bfd_section);
+  first_section_name = bfd_section_name (objfile->sections[0].the_bfd_section);
 
   if (objfile->sect_index_text == 0
       && strcmp (first_section_name, ".text") != 0)
@@ -3091,7 +3090,7 @@ xcoff_get_core_n_import_files (bfd *abfd)
   if (sect == NULL)
     return -1;  /* Not a core file.  */
 
-  for (offset = 0; offset < bfd_get_section_size (sect);)
+  for (offset = 0; offset < bfd_section_size (sect);)
     {
       int next;
 
This page took 0.026592 seconds and 4 git commands to generate.