Fix the read/write flag for these registers on AArch64
[deliverable/binutils-gdb.git] / gdb / coffread.c
index 62b6d7945a861510897f851e33aa5b9324fc23c0..30583e1dda46fb6460ee54635b5de176d4aab33e 100644 (file)
@@ -1,5 +1,5 @@
 /* Read coff symbol tables and convert to internal format, for GDB.
-   Copyright (C) 1987-2017 Free Software Foundation, Inc.
+   Copyright (C) 1987-2018 Free Software Foundation, Inc.
    Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
 
    This file is part of GDB.
@@ -699,7 +699,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
        }
     }
 
-  bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
+  if (!(objfile->flags & OBJF_READNEVER))
+    bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
 
   if (info->stabsects)
     {
@@ -732,20 +733,17 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
   /* Try to add separate debug file if no symbols table found.   */
   if (!objfile_has_partial_symbols (objfile))
     {
-      char *debugfile;
+      std::string debugfile = find_separate_debug_file_by_buildid (objfile);
 
-      debugfile = find_separate_debug_file_by_buildid (objfile);
-
-      if (debugfile == NULL)
+      if (debugfile.empty ())
        debugfile = find_separate_debug_file_by_debuglink (objfile);
-      make_cleanup (xfree, debugfile);
 
-      if (debugfile)
+      if (!debugfile.empty ())
        {
-         gdb_bfd_ref_ptr abfd (symfile_bfd_open (debugfile));
+         gdb_bfd_ref_ptr abfd (symfile_bfd_open (debugfile.c_str ()));
 
-         symbol_file_add_separate (abfd.get (), debugfile, symfile_flags,
-                                   objfile);
+         symbol_file_add_separate (abfd.get (), debugfile.c_str (),
+                                   symfile_flags, objfile);
        }
     }
 
@@ -768,8 +766,6 @@ coff_symfile_finish (struct objfile *objfile)
 {
   /* Let stabs reader clean up.  */
   stabsread_clear_cache ();
-
-  dwarf2_free_objfile (objfile);
 }
 \f
 
@@ -898,8 +894,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
        case C_LINE:
        case C_ALIAS:
        case C_HIDDEN:
-         complaint (&symfile_complaints,
-                    _("Bad n_sclass for symbol %s"),
+         complaint (_("Bad n_sclass for symbol %s"),
                     cs->c_name);
          break;
 
@@ -930,6 +925,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
             backtraces, so filter them out (from phdm@macqel.be).  */
          if (within_function)
            break;
+         /* Fall through.  */
        case C_STAT:
        case C_THUMBLABEL:
        case C_THUMBSTAT:
@@ -966,7 +962,8 @@ coff_symtab_read (minimal_symbol_reader &reader,
            /* At least on a 3b1, gcc generates swbeg and string labels
               that look like this.  Ignore them.  */
            break;
-         /* Fall in for static symbols that don't start with '.'  */
+         /* For static symbols that don't start with '.'...  */
+         /* Fall through.  */
        case C_THUMBEXT:
        case C_THUMBEXTFUNC:
        case C_EXT:
@@ -1066,8 +1063,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
              /* main_aux.x_sym.x_misc.x_lnsz.x_lnno
                 contains line number of '{' }.  */
              if (cs->c_naux != 1)
-               complaint (&symfile_complaints,
-                          _("`.bf' symbol %d has no aux entry"),
+               complaint (_("`.bf' symbol %d has no aux entry"),
                           cs->c_symnum);
              fcn_first_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
              fcn_first_line_addr = cs->c_value;
@@ -1093,8 +1089,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
 
              if (context_stack_depth <= 0)
                {       /* We attempted to pop an empty context stack.  */
-                 complaint (&symfile_complaints,
-                            _("`.ef' symbol without matching `.bf' "
+                 complaint (_("`.ef' symbol without matching `.bf' "
                               "symbol ignored starting at symnum %d"),
                             cs->c_symnum);
                  within_function = 0;
@@ -1105,8 +1100,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
              /* Stack must be empty now.  */
              if (context_stack_depth > 0 || newobj == NULL)
                {
-                 complaint (&symfile_complaints,
-                            _("Unmatched .ef symbol(s) ignored "
+                 complaint (_("Unmatched .ef symbol(s) ignored "
                               "starting at symnum %d"),
                             cs->c_symnum);
                  within_function = 0;
@@ -1114,8 +1108,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
                }
              if (cs->c_naux != 1)
                {
-                 complaint (&symfile_complaints,
-                            _("`.ef' symbol %d has no aux entry"),
+                 complaint (_("`.ef' symbol %d has no aux entry"),
                             cs->c_symnum);
                  fcn_last_line = 0x7FFFFFFF;
                }
@@ -1160,8 +1153,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
            {
              if (context_stack_depth <= 0)
                {       /* We attempted to pop an empty context stack.  */
-                 complaint (&symfile_complaints,
-                            _("`.eb' symbol without matching `.bb' "
+                 complaint (_("`.eb' symbol without matching `.bb' "
                               "symbol ignored starting at symnum %d"),
                             cs->c_symnum);
                  break;
@@ -1170,8 +1162,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
              newobj = pop_context ();
              if (depth-- != newobj->depth)
                {
-                 complaint (&symfile_complaints,
-                            _("Mismatched .eb symbol ignored "
+                 complaint (_("Mismatched .eb symbol ignored "
                               "starting at symnum %d"),
                             symnum);
                  break;
@@ -1480,8 +1471,7 @@ enter_linenos (long file_offset, int first_line,
     return;
   if (file_offset < linetab_offset)
     {
-      complaint (&symfile_complaints,
-                _("Line number pointer %ld lower than start of line numbers"),
+      complaint (_("Line number pointer %ld lower than start of line numbers"),
                 file_offset);
       if (file_offset > linetab_size)  /* Too big to be an offset?  */
        return;
@@ -1789,11 +1779,11 @@ process_coff_symbol (struct coff_symbol *cs,
          /* Some compilers try to be helpful by inventing "fake"
             names for anonymous enums, structures, and unions, like
             "~0fake" or ".0fake".  Thanks, but no thanks...  */
-         if (TYPE_TAG_NAME (SYMBOL_TYPE (sym)) == 0)
+         if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
            if (SYMBOL_LINKAGE_NAME (sym) != NULL
                && *SYMBOL_LINKAGE_NAME (sym) != '~'
                && *SYMBOL_LINKAGE_NAME (sym) != '.')
-             TYPE_TAG_NAME (SYMBOL_TYPE (sym)) =
+             TYPE_NAME (SYMBOL_TYPE (sym)) =
                concat (SYMBOL_LINKAGE_NAME (sym), (char *)NULL);
 
          add_symbol_to_list (sym, &file_symbols);
@@ -1877,8 +1867,7 @@ decode_type (struct coff_symbol *cs, unsigned int c_type,
        }
       else
        {
-         complaint (&symfile_complaints,
-                    _("Symbol table entry for %s has bad tagndx value"),
+         complaint (_("Symbol table entry for %s has bad tagndx value"),
                     cs->c_name);
          /* And fall through to decode_base_type...  */
        }
@@ -1959,10 +1948,6 @@ decode_base_type (struct coff_symbol *cs,
          type = coff_alloc_type (cs->c_symnum);
          TYPE_CODE (type) = TYPE_CODE_STRUCT;
          TYPE_NAME (type) = NULL;
-         /* This used to set the tag to "<opaque>".  But I think
-            setting it to NULL is right, and the printing code can
-            print it as "struct {...}".  */
-         TYPE_TAG_NAME (type) = NULL;
          INIT_CPLUS_SPECIFIC (type);
          TYPE_LENGTH (type) = 0;
          TYPE_FIELDS (type) = 0;
@@ -1983,10 +1968,6 @@ decode_base_type (struct coff_symbol *cs,
          /* Anonymous union type.  */
          type = coff_alloc_type (cs->c_symnum);
          TYPE_NAME (type) = NULL;
-         /* This used to set the tag to "<opaque>".  But I think
-            setting it to NULL is right, and the printing code can
-            print it as "union {...}".  */
-         TYPE_TAG_NAME (type) = NULL;
          INIT_CPLUS_SPECIFIC (type);
          TYPE_LENGTH (type) = 0;
          TYPE_FIELDS (type) = 0;
@@ -2009,10 +1990,6 @@ decode_base_type (struct coff_symbol *cs,
          type = coff_alloc_type (cs->c_symnum);
          TYPE_CODE (type) = TYPE_CODE_ENUM;
          TYPE_NAME (type) = NULL;
-         /* This used to set the tag to "<opaque>".  But I think
-            setting it to NULL is right, and the printing code can
-            print it as "enum {...}".  */
-         TYPE_TAG_NAME (type) = NULL;
          TYPE_LENGTH (type) = 0;
          TYPE_FIELDS (type) = 0;
          TYPE_NFIELDS (type) = 0;
@@ -2047,8 +2024,7 @@ decode_base_type (struct coff_symbol *cs,
       else
        return objfile_type (objfile)->builtin_unsigned_long;
     }
-  complaint (&symfile_complaints, 
-            _("Unexpected type for symbol %s"), cs->c_name);
+  complaint (_("Unexpected type for symbol %s"), cs->c_name);
   return objfile_type (objfile)->builtin_void;
 }
 \f
This page took 0.026804 seconds and 4 git commands to generate.