From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22228 invoked by alias); 23 Aug 2002 01:35:55 -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 22221 invoked from network); 23 Aug 2002 01:35:55 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 23 Aug 2002 01:35:55 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id SAA11031; Thu, 22 Aug 2002 18:29:59 -0700 (PDT) Message-ID: <3D659178.25167F02@redhat.com> Date: Thu, 22 Aug 2002 18:37:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Joel Brobecker CC: 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> Content-Type: multipart/mixed; boundary="------------F5DD8B4658849389D484ACE4" X-SW-Source: 2002-08/txt/msg00744.txt.bz2 This is a multi-part message in MIME format. --------------F5DD8B4658849389D484ACE4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 599 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? --------------F5DD8B4658849389D484ACE4 Content-Type: text/plain; charset=us-ascii; name="joel2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="joel2.diff" Content-length: 1060 *** 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) { --------------F5DD8B4658849389D484ACE4--