From 8275e802a7f87d3a19c6355e45dfbf322b2ef80a Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 6 Aug 1992 17:58:26 +0000 Subject: [PATCH] * buildsym.c (end_symtab): Make copy of dirname on symbol obstack. --- gdb/ChangeLog | 4 ++++ gdb/buildsym.c | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6b22c7be40e..3180586edd1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 90cbbe42f9d..208d2077607 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; -- 2.30.2