From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16656 invoked by alias); 13 Mar 2012 23:09:49 -0000 Received: (qmail 16647 invoked by uid 22791); 13 Mar 2012 23:09:48 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from elasmtp-curtail.atl.sa.earthlink.net (HELO elasmtp-curtail.atl.sa.earthlink.net) (209.86.89.64) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Mar 2012 23:09:35 +0000 Received: from [68.96.200.16] (helo=macbook2.local) by elasmtp-curtail.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1S7aqU-0004jF-Dr; Tue, 13 Mar 2012 19:09:34 -0400 Message-ID: <4F5FD3A6.1090106@earthlink.net> Date: Tue, 13 Mar 2012 23:09:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Andreas Schwab CC: gdb-patches@sourceware.org Subject: Re: [PATCH] dynamic printf References: <4F4DCDD5.2040807@earthlink.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: ae6f8838ff913eba0cc1426638a40ef67e972de0d01da940ac8e1e1c62b1b826670e73fdc04123ac350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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: 2012-03/txt/msg00456.txt.bz2 On 2/29/12 1:14 AM, Andreas Schwab wrote: > Stan Shebs writes: > >> This patch implements a "dynamic printf", which is basically a breakpoint >> with a printf;continue as its command list - but with additional features >> that make it more interesting. > How about: > > break [LOCATION] [thread THREADNUM] [if CONDITION] [printf FORMAT,ARGS...] > > Andreas. > I've been wondering whether that might be a better idea. An advantage of "dprintf" for the command line is that it can abbreviate to just "dp" and tab completion works, while the optional arguments to the break command don't have any way to abbreviate (although they probably could). That's not super-compelling, as by its nature a printf command entails typing in format string, double quotes and newlines and all, and in practice I expect a lot of these will tend to accumulate in script files. Another consideration is how the collection looks in an info break command. If dynamic prints are a different kind of breakpoint, then you can (in theory) filter the breakpoint listing to a single category, but if they are just breakpoints with special commands, they'll continue to be in the big list. My intuition isn't giving me a strong read on which approach users will like better. As the goal is at least partly to entice printf()+recompile users into using a GDB command instead, I think it needs to be among GDB's simpler commands. Maybe include both syntaxes, mapping down to same functionality? Stan