ld -plugin options when plugins are disabled
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 715009dc9578346cf02065546434d2c980d4202a..1e1a5dc9b979e520c7859eb1b32046b6670efcff 100644 (file)
@@ -268,7 +268,7 @@ static void read_ofile_symtab (struct objfile *, legacy_psymtab *);
 static void dbx_read_symtab (legacy_psymtab *self,
                             struct objfile *objfile);
 
-static void dbx_psymtab_to_symtab_1 (legacy_psymtab *, struct objfile *);
+static void dbx_expand_psymtab (legacy_psymtab *, struct objfile *);
 
 static void read_dbx_symtab (minimal_symbol_reader &, struct objfile *);
 
@@ -951,7 +951,7 @@ function_outside_compilation_unit_complaint (const char *arg1)
 static void
 read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct external_nlist *bufp = 0;     /* =0 avoids gcc -Wall glitch.  */
   struct internal_nlist nlist;
   CORE_ADDR text_addr;
@@ -1434,12 +1434,13 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
          if (psymtab_language == language_cplus)
            {
              std::string name (namestring, p - namestring);
-             std::string new_name = cp_canonicalize_string (name.c_str ());
-             if (!new_name.empty ())
+             gdb::unique_xmalloc_ptr<char> new_name
+               = cp_canonicalize_string (name.c_str ());
+             if (new_name != nullptr)
                {
-                 sym_len = new_name.length ();
+                 sym_len = strlen (new_name.get ());
                  sym_name = obstack_strdup (&objfile->objfile_obstack,
-                                            new_name);
+                                            new_name.get ());
                }
            }
 
@@ -1909,7 +1910,7 @@ start_psymtab (struct objfile *objfile, const char *filename, CORE_ADDR textlow,
     XOBNEW (&objfile->objfile_obstack, struct symloc);
   LDSYMOFF (result) = ldsymoff;
   result->legacy_read_symtab = dbx_read_symtab;
-  result->legacy_expand_psymtab = dbx_psymtab_to_symtab_1;
+  result->legacy_expand_psymtab = dbx_expand_psymtab;
   SYMBOL_SIZE (result) = symbol_size;
   SYMBOL_OFFSET (result) = symbol_table_offset;
   STRING_OFFSET (result) = string_table_offset;
@@ -1936,7 +1937,7 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
                 int textlow_not_set)
 {
   int i;
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
 
   if (capping_symbol_offset != -1)
     LDSYMLEN (pst) = capping_symbol_offset - LDSYMOFF (pst);
@@ -2066,7 +2067,7 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
 }
 \f
 static void
-dbx_psymtab_to_symtab_1 (legacy_psymtab *pst, struct objfile *objfile)
+dbx_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
 {
   gdb_assert (!pst->readin);
 
@@ -2338,7 +2339,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
                    const section_offsets &section_offsets,
                    struct objfile *objfile, enum language language)
 {
-  struct gdbarch *gdbarch = get_objfile_arch (objfile);
+  struct gdbarch *gdbarch = objfile->arch ();
   struct context_stack *newobj;
   struct context_stack cstk;
   /* This remembers the address of the start of a function.  It is
This page took 0.025601 seconds and 4 git commands to generate.