This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] GDB/624 - tbreak commands not executed when breakpoint hit
- From: Michael Snyder <msnyder at redhat dot com>
- To: Joel Brobecker <brobecker at gnat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 22 Aug 2002 18:35:52 -0700
- Subject: Re: [RFA] GDB/624 - tbreak commands not executed when breakpoint hit
- Organization: Red Hat, Inc.
- References: <20020731200936.GL683@gnat.com> <3D6560A2.BEA0B7DD@redhat.com> <20020822223142.GS25997@gnat.com>
Joel Brobecker wrote:
>
> Michael,
>
> > Joel, this implementation, with its use of delete_at_next_stop,
> > seems clumsy and, to be frank, scary. Instead, what if you just
> > made a temporary copy of the tbreak command-list (like you do for
> > GDB/622), then delete the breakpoint, and later execute the commands?
>
> Thanks for your review. I need a bit of time to delve into this again,
> but I'll be quite busy in the next 2 or 3 weeks. You can consider this
> patch withdrawn in the meantime.
Aww, come on. ;-)
OK, maybe it's fresher in my mind now than it is in yours.
How about this?
*** breakpoint.joel1.c Thu Aug 22 17:01:02 2002
--- breakpoint.c Thu Aug 22 17:56:03 2002
*************** void
*** 6594,6604 ****
breakpoint_auto_delete (bpstat bs)
{
struct breakpoint *b, *temp;
for (; bs; bs = bs->next)
if (bs->breakpoint_at && bs->breakpoint_at->disposition == disp_del
&& bs->stop)
! delete_breakpoint (bs->breakpoint_at);
ALL_BREAKPOINTS_SAFE (b, temp)
{
--- 6594,6614 ----
breakpoint_auto_delete (bpstat bs)
{
struct breakpoint *b, *temp;
+ struct command_line *cmd;
for (; bs; bs = bs->next)
if (bs->breakpoint_at && bs->breakpoint_at->disposition == disp_del
&& bs->stop)
! {
! /* Deleting a temp breakpoint. If it has commands associated
! with it, preserve them in the in the bpstat list, so they
! can be executed by bpstat_do_actions. */
!
! cmd = copy_command_lines (bs->commands);
! make_cleanup_free_command_lines (&cmd);
! delete_breakpoint (bs->breakpoint_at);
! bs->commands = cmd;
! }
ALL_BREAKPOINTS_SAFE (b, temp)
{