From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67085 invoked by alias); 16 Mar 2017 08:58:05 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 67002 invoked by uid 89); 16 Mar 2017 08:58:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: gproxy3-pub.mail.unifiedlayer.com Received: from gproxy3-pub.mail.unifiedlayer.com (HELO gproxy3-pub.mail.unifiedlayer.com) (69.89.30.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Thu, 16 Mar 2017 08:58:02 +0000 Received: (qmail 11750 invoked by uid 0); 16 Mar 2017 08:58:02 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy3.mail.unifiedlayer.com with SMTP; 16 Mar 2017 08:58:02 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id wYxy1u00b2f2jeq01Yy1Rk; Thu, 16 Mar 2017 02:58:02 -0600 X-Authority-Analysis: v=2.1 cv=Ath9goNP c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=6Iz7jQTuP9IA:10 a=CCpqsmhAAAAA:8 a=SKRNHAOBFzOFDrs4lc0A:9 a=QEXdDO2ut3YA:10 a=2bEJzN025okA:10 a=ul9cdbp4aOFLsgKbc677:22 Received: from [89.202.203.52] (port=1322 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1coREM-0001XD-5h; Thu, 16 Mar 2017 02:57:58 -0600 From: Tom Tromey To: Juraj =?utf-8?B?T3LFoXVsacSH?= Cc: Subject: Re: "continue" in breakpoint commands breaks line-by-line stepping References: Date: Thu, 16 Mar 2017 08:58:00 -0000 In-Reply-To: ("Juraj \=\?utf-8\?B\?T3LFoXVsacSHIidz\?\= message of "Fri, 10 Mar 2017 09:24:45 +0100") Message-ID: <871stx8upa.fsf@pokyo> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BWhitelist: no X-Exim-ID: 1coREM-0001XD-5h X-Source-Sender: (pokyo) [89.202.203.52]:1322 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2017-03/txt/msg00021.txt.bz2 >>>>> "Juraj" =3D=3D Juraj Or=C5=A1uli=C4=87 writes: Juraj> Hi everyone, I have a quick question. I have added some breakpoint Juraj> commands for logging using the "commands" command. Since I don't want Juraj> to stop the execution in these points, I added a "continue", as Juraj> mentioned in https://sourceware.org/gdb/onlinedocs/gdb/Break-Command= s.html. Juraj> However, this breaks stepping line-by-line in outer frames - if I Juraj> stumple upon one of these logging breakpoints, it issues a "continue= ", Juraj> and I lose control if I call "next" when I am in an outer frame. How Juraj> could I mitigate this? Perhaps by redefining "next" to set a tempora= ry Juraj> breakpoint on the next line to ensure that I stop there? Should this Juraj> be the default behavior? There are a few reasonably good ways to deal with the "next-over-continue" issue. One way, specifically for logging, is to use the dprintf command instead of a breakpoint+commands. dprintf doesn't have this problem. Another way, if you need something more generic, is to use Python to create your breakpoints and do your actions in the |stop| method. This was introduced specifically to deal with this problem. A third way, specific to modifying a variable, is not to do this: b x commands silent set y =3D 73 cont end but instead: b x if y =3D 73, 1 Breakpoint conditions are evaluated at a different time and don't affect "next"ing. I think it would be good if the "Break Commands" documentation was updated to mention dprintf and the variable setting scenario, and to point out the next-over-continue problem. Maybe gdb could introduce some kind of flag to "continue" to breakpoints to solve this problem more generally. Tom