diff options
author | Fred Fish <fnf@specifix.com> | 1992-03-27 01:04:14 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-03-27 01:04:14 +0000 |
commit | 3624c875921a343ff6e5a96fb004296dd4d1d253 (patch) | |
tree | 2f5ae3448a7690849d9e251e90bdb087865cc3d2 /gdb/objfiles.c | |
parent | 17904eeb4dae7d47bd83398c33ccae3be5ed6dee (diff) | |
download | gdb-3624c875921a343ff6e5a96fb004296dd4d1d253.zip gdb-3624c875921a343ff6e5a96fb004296dd4d1d253.tar.gz gdb-3624c875921a343ff6e5a96fb004296dd4d1d253.tar.bz2 |
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.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 9 |
1 files changed, 5 insertions, 4 deletions
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); } } |