+2009-03-11 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * breakpoint.c (bpstat_check_breakpoint_conditions): Use
+ value_mark and value_free_to_mark.
+ * objfiles.c (free_objfile): Call objfile_free_data before
+ freeing the BFD.
+
2009-03-10 Hui Zhu <teawater@gmail.com>
* disasm.c (gdb_disassembly): Remove unused argument
if (bl->cond && bl->owner->disposition != disp_del_at_next_stop)
{
+ /* We use value_mark and value_free_to_mark because it could
+ be a long time before we return to the command level and
+ call free_all_values. We can't call free_all_values
+ because we might be in the middle of evaluating a
+ function call. */
+ struct value *mark = value_mark ();
+
/* Need to select the frame, with all that implies
so that the conditions will have the right context. */
select_frame (get_current_frame ());
"Error in testing breakpoint condition:\n",
RETURN_MASK_ALL);
/* FIXME-someday, should give breakpoint # */
- free_all_values ();
+ value_free_to_mark (mark);
}
if (bl->cond && value_is_zero)
{
(*objfile->sf->sym_finish) (objfile);
}
+ /* Discard any data modules have associated with the objfile. */
+ objfile_free_data (objfile);
+
/* We always close the bfd, unless the OBJF_KEEPBFD flag is set. */
if (objfile->obfd != NULL && !(objfile->flags & OBJF_KEEPBFD))
/* The last thing we do is free the objfile struct itself. */
- objfile_free_data (objfile);
if (objfile->name != NULL)
{
xfree (objfile->name);