From 3624c875921a343ff6e5a96fb004296dd4d1d253 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Fri, 27 Mar 1992 01:04:14 +0000 Subject: Mostly changes to dbxread.c to preserve stringtab's on a per-objfile basis, for use in expanding psymtabs to full symtabs. See ChangeLog for other details. --- gdb/objfiles.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gdb/objfiles.c') diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 35121a9..66bfd56 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -88,6 +88,8 @@ allocate_objfile (abfd, mapped) } else if ((objfile = (struct objfile *) mmalloc_getkey (md, 0)) != NULL) { + /* Update memory corruption handler function addresses. */ + init_malloc (md); objfile -> md = md; /* Update pointers to functions to *our* copies */ obstack_chunkfun (&objfile -> psymbol_obstack, xmmalloc); @@ -96,11 +98,12 @@ allocate_objfile (abfd, mapped) obstack_freefun (&objfile -> symbol_obstack, mfree); obstack_chunkfun (&objfile -> type_obstack, xmmalloc); obstack_freefun (&objfile -> type_obstack, mfree); - /* Update memory corruption handler function addresses */ - init_malloc (objfile -> md); } else { + /* Set up to detect internal memory corruption. MUST be done before + the first malloc. See comments in init_malloc() and mmcheck(). */ + init_malloc (md); objfile = (struct objfile *) xmmalloc (md, sizeof (struct objfile)); (void) memset (objfile, 0, sizeof (struct objfile)); objfile -> md = md; @@ -115,8 +118,6 @@ allocate_objfile (abfd, mapped) obstack_full_begin (&objfile -> type_obstack, 0, 0, xmmalloc, mfree, objfile -> md, OBSTACK_MMALLOC_LIKE); - /* Set up to detect internal memory corruption */ - init_malloc (objfile -> md); } } -- cgit v1.1