From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9951 invoked by alias); 18 Feb 2013 21:36:50 -0000 Received: (qmail 9881 invoked by uid 22791); 18 Feb 2013 21:36:49 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 21:36:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 938032E0E0; Mon, 18 Feb 2013 16:36:43 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QcreslP3uKv0; Mon, 18 Feb 2013 16:36:43 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 60B662E0CD; Mon, 18 Feb 2013 16:36:43 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 6D9DBC3465; Mon, 18 Feb 2013 13:36:41 -0800 (PST) Date: Mon, 18 Feb 2013 21:36:00 -0000 From: Joel Brobecker To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [RFC] PR 15075 dprintf interferes with "next" Message-ID: <20130218213641.GA22143@adacore.com> References: <1361192891-29341-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1361192891-29341-1-git-send-email-yao@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2013-02/txt/msg00480.txt.bz2 > I'd like to get your comments on this patch, as I think my patch is > hacky but I am unable to figure out a correct one. This patch fixes more > problems than PR 15075 mentioned, they are, > > - When step a source line by "next" command, and there is a dprintf > on that line, "next" command will behave like "continue". > - Two dprintf are set on the same address. Only one printf is > executed. > - dprintf and regular breakpoint are set on the same address, > inferior doesn't stop. > > In order to fix these problems, I don't append "continue" command to > dprintf breakpoint, and after all commands of all breakpoints (caused > the stop) are executed, execute "continue" command if > 1) the inferior is not proceeded by these commands > 2) and the stop is only caused by dprintf (no other types of > breakpoint) > 3) the inferior is not in the state of stepping a source line or > an instruction (to fix PR 15075). > > My patch fixes all the three known problems, but I think it is still > hacky. My first reaction is that we'd better just byte the bullet, and implement this properly. In my opinion, something at the infrun/ handle_inferior_event level... Pedro is a specialist of the dreaded handle_inferior_event function, so he might have a more precise suggestion. Interestingly enough, I did point out these limitations, but we still went ahead, as we thought that the feature would be useful... -- Joel