+Tue Jul 27 12:36:49 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * breakpoint.c (breakpoint_1): Walk the breakpoint chain to decide if
+ we have breakpoints or watchpoints as we might have to ignore internal
+ breakpoints.
+
+ Fix gdb core dumps after `file newfile' commands.
+ * symtab.h, symfile.c (clear_symtab_users): New routine which
+ unconditionally clears symtab users. clear_symtab_users_once
+ commented out as it was a noop anyway.
+ * objfiles.c (free_objfile): Don't call clear_symtab_users_once.
+ * objfiles.c (free_all_objfiles), symfile.c (new_symfile_objfile),
+ xcoffexec.c (exec_close): Call clear_symtab_users if necessary.
+ * symfile.c (syms_from_objfile): Install cleanups for errors during
+ symbol reading.
+ * coffread.c, dbxread.c, mipsread.c, xcoffread.c (*_symfile_read):
+ Lint cleanup code, call do_cleanups explicitly.
+ * symfile.c (symbol_file_add): Call new_symfile_objfile and
+ reinit_frame_cache _after_ the new symbols are read in.
+
Tue Jul 27 01:57:01 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* mipsread.c (parse_type): Do not set tag name for compiler
{
bfd *sym_bfd;
int val;
+ struct cleanup *back_to;
sym_bfd = objfile->obfd;
val = bfd_seek (objfile->obfd, DBX_SYMTAB_OFFSET (objfile), SEEK_SET);
symbol_table_offset = DBX_SYMTAB_OFFSET (objfile);
pending_blocks = 0;
- make_cleanup (really_free_pendings, 0);
+ back_to = make_cleanup (really_free_pendings, 0);
init_minimal_symbol_collection ();
make_cleanup (discard_minimal_symbols, 0);
printf_filtered ("(no debugging symbols found)...");
wrap_here ("");
}
+
+ do_cleanups (back_to);
}
/* Initialize anything that needs initializing when a completely new
int nsl;
int past_first_source_file = 0;
CORE_ADDR last_o_file_start = 0;
- struct cleanup *old_chain;
+ struct cleanup *back_to;
bfd *abfd;
/* End of the text segment of the executable file. */
(struct partial_symtab **) alloca (dependencies_allocated *
sizeof (struct partial_symtab *));
- old_chain = make_cleanup (free_objfile, objfile);
-
/* Init bincl list */
init_bincl_list (20, objfile);
- make_cleanup (free_bincl_list, objfile);
+ back_to = make_cleanup (free_bincl_list, objfile);
last_source_file = NULL;
dependency_list, dependencies_used);
}
- free_bincl_list (objfile);
- discard_cleanups (old_chain);
+ do_cleanups (back_to);
}
/* Allocate and partially fill a partial symtab. It will be
is unknown, but we play it safe for now and keep each action until
it is shown to be no longer needed. */
- clear_symtab_users_once ();
#if defined (CLEAR_SOLIB)
CLEAR_SOLIB ();
#endif
}
-/* Free all the object files at once. */
+/* Free all the object files at once and clean up their users. */
void
free_all_objfiles ()
{
free_objfile (objfile);
}
+ clear_symtab_users ();
}
\f
/* Relocate OBJFILE to NEW_OFFSETS. There should be OBJFILE->NUM_SECTIONS
{
register struct vmap *vp, *nxt;
struct objfile *obj;
+ int need_symtab_cleanup = 0;
for (nxt = vmap; vp = nxt; )
{
free_objfile() will do proper cleanup of objfile *and* bfd. */
if (vp->objfile)
- free_objfile (vp->objfile);
+ {
+ free_objfile (vp->objfile);
+ need_symtab_cleanup = 1;
+ }
else
bfd_close(vp->bfd);
exec_ops.to_sections = NULL;
exec_ops.to_sections_end = NULL;
}
+
+ if (need_symtab_cleanup)
+ clear_symtab_users ();
}
/*
static int
init_lineno PARAMS ((bfd *, file_ptr, int));
+static void
+free_linetab PARAMS ((void));
+
static void
find_linenos PARAMS ((bfd *, sec_ptr, PTR));
{
int val;
+ free_linetab ();
+
if (bfd_seek(abfd, offset, L_SET) < 0)
return -1;
linetab_offset = offset;
linetab_size = size;
- make_cleanup (free, linetab); /* Be sure it gets de-allocated. */
return 0;
}
+
+static void
+free_linetab ()
+{
+ if (linetab)
+ free (linetab);
+ linetab = NULL;
+}
\f
/* dbx allows the text of a symbol name to be continued into the
next symbol name! When such a continuation is encountered
bfd *abfd;
struct coff_symfile_info *info;
char *name;
+ struct cleanup *back_to = make_cleanup (null_cleanup, 0);
info = (struct coff_symfile_info *) objfile -> sym_private;
symfile_bfd = abfd = objfile->obfd;
&& info->max_lineno_offset > info->min_lineno_offset) {
/* only read in the line # table if one exists */
+ make_cleanup (free_linetab, 0);
val = init_lineno(abfd, info->min_lineno_offset,
(int) (info->max_lineno_offset - info->min_lineno_offset));
minimal symbols for this objfile. */
install_minimal_symbols (objfile);
+
+ do_cleanups (back_to);
}
/* XCOFF-specific parsing routine for section offsets. */