* buildsym.c (end_symtab): Make copy of dirname on symbol obstack.
authorFred Fish <fnf@specifix.com>
Thu, 6 Aug 1992 17:58:26 +0000 (17:58 +0000)
committerFred Fish <fnf@specifix.com>
Thu, 6 Aug 1992 17:58:26 +0000 (17:58 +0000)
gdb/ChangeLog
gdb/buildsym.c

index 6b22c7be40e5fc8c38d79fb6306f113187d8464d..3180586edd10e0e67ff6d110f5242425e3161ac9 100644 (file)
@@ -1,3 +1,7 @@
+Thu Aug  6 10:56:01 1992  Fred Fish  (fnf@cygnus.com)
+
+       * buildsym.c (end_symtab):  Make copy of dirname on symbol obstack.
+
 Wed Aug  5 01:42:40 1992  John Gilmore  (gnu at cygnus.com)
 
        * remote-udi.c:  Update comments.
index 90cbbe42f9de8b3eba5dd7f4c10da4826790f2e6..208d207760725dac13525c7e3bdd450f4b87b5ed 100644 (file)
@@ -668,7 +668,18 @@ end_symtab (end_addr, sort_pending, sort_linevec, objfile)
            {
              symtab->linetable = NULL;
            }
-         symtab->dirname = subfile->dirname;
+         if (subfile->dirname)
+           {
+             /* Reallocate the dirname on the symbol obstack */
+             symtab->dirname = (char *)
+               obstack_alloc (&objfile -> symbol_obstack,
+                              strlen (subfile -> dirname) + 1);
+             strcpy (symtab->dirname, subfile->dirname);
+           }
+         else
+           {
+             symtab->dirname = NULL;
+           }
          symtab->free_code = free_linetable;
          symtab->free_ptr = NULL;