From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6033 invoked by alias); 22 Aug 2011 17:06:35 -0000 Received: (qmail 6020 invoked by uid 22791); 22 Aug 2011 17:06:33 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Aug 2011 17:06:18 +0000 Received: (qmail 14365 invoked from network); 22 Aug 2011 17:06:18 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Aug 2011 17:06:18 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch 2/2] Do not bpstat_clear_actions on throw_exception #3 Date: Mon, 22 Aug 2011 17:06:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: Jan Kratochvil References: <20110822145150.GB11817@host1.jankratochvil.net> In-Reply-To: <20110822145150.GB11817@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108221806.15757.pedro@codesourcery.com> 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/msg00412.txt.bz2 On Monday 22 August 2011 15:51:50, Jan Kratochvil wrote: > On Thu, 18 Aug 2011 18:42:19 +0200, Pedro Alves wrote: > > Unfortunately, the hook-stop handling is in normal_stop. > > Your patch clears the breakpoint commands before get get a chance > > to run if the user installs a hook-stop. E.g., before: > > OK, I agree, I have made a new testcase. Thanks. > > This looks tricky to get right without changing gdb's behavior :-( > > The question is how big changed you were thinking about. > > One problem I find one cannot use "step" and other such commands in the > breakpoints commands lists. This may be due to GDB trying not to overflow its > stack. I gues with async mode it could be implementable as some > stack-in-data-structure. Yes, I going in that direction with , but there are other places I hadn't made fully state-machined on that patch. Unfortunately, I can't afford finishing that one now, and I flipped to a plan B. > But that seems to be out of scope of this patch. For sure. > > We could try pushing bpstat_do_actions to the end of an execution > > command's run, but e.g., that would change the behavior of > > breakpoint commands in command lists, and things like "step N". > > OTOH, maybe that'd be the right thing to do (the current > > behavior could be seen as buggy --- more thought is needed). > > I was playing with various changes but it had various side-effects. > > Do you have anything against this patch? No, looks almost good enough. I like that it's simple. > I hope I have caught all the cases > where exceptions can be thrown. Otherwise IMO everything is caught by > execute_command anyway. Not all cases. In async mode, handle_inferior_event is called _outside_ of execute_command, directly by the event loop (well, almost directly). Thus any exception thrown between bpstat_stop_status is called, and the bpstat_do_actions call in inf-loop.c, will leave the thread with a dangling bpstat too. Might be good enough to wrap handle_inferior_event with a similar cleanup? -- Pedro Alves