Error when gdb_is_target_1 is called without running gdb instance
[binutils-gdb.git] / gdb / symfile.c
index a660422b51e07d2e9d1828eaca6ebba78d66534a..0c8d574e6032403188a340a30c887c843b90fea0 100644 (file)
@@ -1438,7 +1438,7 @@ find_separate_debug_file (const char *dir,
   for (const gdb::unique_xmalloc_ptr<char> &debugdir : debugdir_vec)
     {
       debugfile = target_prefix ? "target:" : "";
-      debugfile += debugdir.get ();
+      debugfile += debugdir;
       debugfile += "/";
       debugfile += drive;
       debugfile += dir_notarget;
@@ -1460,7 +1460,7 @@ find_separate_debug_file (const char *dir,
          /* If the file is in the sysroot, try using its base path in
             the global debugfile directory.  */
          debugfile = target_prefix ? "target:" : "";
-         debugfile += debugdir.get ();
+         debugfile += debugdir;
          debugfile += "/";
          debugfile += base_path;
          debugfile += "/";
@@ -1473,7 +1473,7 @@ find_separate_debug_file (const char *dir,
             the sysroot's global debugfile directory.  */
          debugfile = target_prefix ? "target:" : "";
          debugfile += gdb_sysroot;
-         debugfile += debugdir.get ();
+         debugfile += debugdir;
          debugfile += "/";
          debugfile += base_path;
          debugfile += "/";
@@ -2780,7 +2780,7 @@ allocate_symtab (struct compunit_symtab *cust, const char *filename)
 
   symtab->filename = objfile->intern (filename);
   symtab->fullname = NULL;
-  symtab->language = deduce_language_from_filename (filename);
+  symtab->set_language (deduce_language_from_filename (filename));
 
   /* This can be very verbose with lots of headers.
      Only print at higher debug levels.  */
@@ -2804,19 +2804,10 @@ allocate_symtab (struct compunit_symtab *cust, const char *filename)
     }
 
   /* Add it to CUST's list of symtabs.  */
-  if (cust->filetabs == NULL)
-    {
-      cust->filetabs = symtab;
-      cust->last_filetab = symtab;
-    }
-  else
-    {
-      cust->last_filetab->next = symtab;
-      cust->last_filetab = symtab;
-    }
+  cust->add_filetab (symtab);
 
   /* Backlink to the containing compunit symtab.  */
-  symtab->compunit_symtab = cust;
+  symtab->set_compunit (cust);
 
   return symtab;
 }
@@ -2840,7 +2831,7 @@ allocate_compunit_symtab (struct objfile *objfile, const char *name)
   saved_name = lbasename (name);
   cu->name = obstack_strdup (&objfile->objfile_obstack, saved_name);
 
-  COMPUNIT_DEBUGFORMAT (cu) = "unknown";
+  cu->set_debugformat ("unknown");
 
   if (symtab_create_debug)
     {