RFA: protect breakpoint commands from being freed

Jim Blandy jimb@redhat.com
Sat Dec 13 22:42:00 GMT 2003


Jim Blandy <jimb@redhat.com> writes:

> Andrew Cagney <cagney@gnu.org> writes:
> 
> > > 2003-12-02  Jim Blandy  <jimb@redhat.com>
> > > 	* breakpoint.c (bpstat_do_actions): To ensure that
> > > 	clear_proceed_status doesn't free the command tree we're
> > > 	evaluating out from under us, zero the bpstat's pointer to it, and
> > > 	take care of freeing it ourselves.
> > > 	* cli/cli-script.c (make_cleanup_free_command_lines): Make this
> > > 	function externally visible.
> > > 	* cli/cli-script.h (make_cleanup_free_command_lines): New
> > > 	declaration.
> >
> > Didn't Don Howard fix this?
> 
> I remember Don Howard doing something related to this, but I it must
> have been a separate case.  The regression test I posted makes today's
> GDB crash.

Okay, I looked this up.  Don Howard posted a fix for a slightly
different problem --- the case where the breakpoint is deleted by its
own script.  The eventual solution entailed giving the bpstat its own
copy of the command tree.

The problem my patch addresses is distinct: GDB is freeing the
bpstat's copy before it is done with it.



More information about the Gdb-patches mailing list