From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21757 invoked by alias); 27 Sep 2002 23:10:17 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21743 invoked from network); 27 Sep 2002 23:10:16 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Sep 2002 23:10:16 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 453F33E77; Fri, 27 Sep 2002 19:10:10 -0400 (EDT) Message-ID: <3D94E552.8030003@redhat.com> Date: Fri, 27 Sep 2002 16:10:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Snyder Cc: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFA] GDB/624 - tbreak commands not executed when breakpoint hit References: <20020731200936.GL683@gnat.com> <3D6560A2.BEA0B7DD@redhat.com> <20020822223142.GS25997@gnat.com> <3D659178.25167F02@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00690.txt.bz2 > 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); Won't a discard cleanups be needed here? > ! bs->commands = cmd; > ! } > > ALL_BREAKPOINTS_SAFE (b, temp) > {