aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-08-06 17:58:26 +0000
committerFred Fish <fnf@specifix.com>1992-08-06 17:58:26 +0000
commit8275e802a7f87d3a19c6355e45dfbf322b2ef80a (patch)
tree0ed8a953e8cc779b3cf4ddb151f69d19973cba76 /gdb/buildsym.c
parent4f3569faad5fa83494d22e96a5cf5bb9d89373f2 (diff)
downloadgdb-8275e802a7f87d3a19c6355e45dfbf322b2ef80a.zip
gdb-8275e802a7f87d3a19c6355e45dfbf322b2ef80a.tar.gz
gdb-8275e802a7f87d3a19c6355e45dfbf322b2ef80a.tar.bz2
* buildsym.c (end_symtab): Make copy of dirname on symbol obstack.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 90cbbe4..208d207 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -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;