From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25096 invoked by alias); 22 Aug 2011 14:52:25 -0000 Received: (qmail 25084 invoked by uid 22791); 22 Aug 2011 14:52:22 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Aug 2011 14:51:56 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7MEpm2Y029989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 22 Aug 2011 10:51:48 -0400 Received: from host1.jankratochvil.net (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7MEpjku013622 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Aug 2011 10:51:47 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p7MEpjvf027397; Mon, 22 Aug 2011 16:51:45 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p7MEphFd027394; Mon, 22 Aug 2011 16:51:43 +0200 Date: Mon, 22 Aug 2011 14:52:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: [patch 1/2] Code reshuffle for patch 2/2 [Re: [patch] Do not bpstat_clear_actions on throw_exception] Message-ID: <20110822145142.GA11817@host1.jankratochvil.net> References: <20110805201417.GA23405@host1.jankratochvil.net> <201108081644.08465.pedro@codesourcery.com> <20110818153413.GA23189@host1.jankratochvil.net> <201108181742.19980.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201108181742.19980.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00409.txt.bz2 Hi, just some code moving. Not sure if bpstat_clear_actions name should stay the same but why not. Thanks, Jan gdb/ 2011-08-21 Jan Kratochvil No functionality change. * breakpoint.c (bpstat_clear_actions): Remove the BS parameter, make function comment a reference, new variables tp and bs, move here code from throw_exception. * breakpoint.h (bpstat_clear_actions): Remove the BS parameter, describe it in the comment. * exceptions.c (throw_exception): Remove variable tp, move the code for bpstat_clear_actions to bpstat_clear_actions. --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3186,12 +3186,22 @@ bpstat_num (bpstat *bsp, int *num) return 1; } -/* Modify BS so that the actions will not be performed. */ +/* See breakpoint.h. */ void -bpstat_clear_actions (bpstat bs) +bpstat_clear_actions (void) { - for (; bs != NULL; bs = bs->next) + struct thread_info *tp; + bpstat bs; + + if (ptid_equal (inferior_ptid, null_ptid)) + return; + + tp = find_thread_ptid (inferior_ptid); + if (tp == NULL) + return; + + for (bs = tp->control.stop_bpstat; bs != NULL; bs = bs->next) { decref_counted_command_line (&bs->commands); --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -895,8 +895,9 @@ extern int bpstat_num (bpstat *, int *); command loop). */ extern void bpstat_do_actions (void); -/* Modify BS so that the actions will not be performed. */ -extern void bpstat_clear_actions (bpstat); +/* Modify all entries of STOP_BPSTAT of INFERIOR_PTID so that the actions will + not be performed. */ +extern void bpstat_clear_actions (void); /* Implementation: */ --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -207,21 +207,12 @@ exceptions_state_mc_action_iter_1 (void) void throw_exception (struct gdb_exception exception) { - struct thread_info *tp = NULL; - quit_flag = 0; immediate_quit = 0; - if (!ptid_equal (inferior_ptid, null_ptid)) - tp = find_thread_ptid (inferior_ptid); - /* Perhaps it would be cleaner to do this via the cleanup chain (not sure I can think of a reason why that is vital, though). */ - if (tp != NULL) - { - /* Clear queued breakpoint commands. */ - bpstat_clear_actions (tp->control.stop_bpstat); - } + bpstat_clear_actions (); do_cleanups (ALL_CLEANUPS);