From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26475 invoked by alias); 19 May 2009 04:13:50 -0000 Received: (qmail 26465 invoked by uid 22791); 19 May 2009 04:13:49 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 May 2009 04:13:42 +0000 Received: (qmail 1756 invoked from network); 19 May 2009 04:13:40 -0000 Received: from unknown (HELO macbook-2.local) (stan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 19 May 2009 04:13:40 -0000 Message-ID: <4A1231EF.1030307@codesourcery.com> Date: Tue, 19 May 2009 04:13:00 -0000 From: Stan Shebs User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: tromey@redhat.com CC: Stan Shebs , Tristan Gingold , gdb-patches@sourceware.org Subject: Re: RFA: makes darwin-nat.c threads (and multi-processes) aware References: <20090319141746.GA81236@ulanbator.act-europe.fr> <4A11BE08.3090900@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-05/txt/msg00391.txt.bz2 Tom Tromey wrote: >>>>>> "Stan" == Stan Shebs writes: >>>>>> > > Stan> Seeing all the inferior_debug calls with different args, while I'm > Stan> working on fixing up tracepoints, gets me to thinking about whether we > Stan> can use tracepoints instead of ever-more debug printfs in GDB (looks > Stan> bad when the chefs in the kitchen send next door for takeout :-) ), > Stan> but that's a subject of its own... > > I have wondered about this myself -- not using tracepoints, exactly, > but a new command implemented in Python that is basically a > combination of "break" and "printf" with an implicit "cont". > > The problem I didn't know how to solve was naming the locations of the > debugging prints such that the location remains meaningful when the > source changes. Function names work pretty well, of course, but they > are also limited when you have a very large function. > Code annotation seems reasonable for when you want data collected at other than the entry point. One could even add the command itself in a comment - /* trace __FILE__:__LINE__ pid, kret, *addrptr */, then extract them as part of setting up a debugging environment. This might be more trouble to set up than printfs, but one of the arguments for printfs - that they don't disrupt behavior by stopping GDB in time-sensitive places - goes away with nonstop. We have a higher-powered debugger than formerly, but we're so used to the old GDB that we're not yet taking advantage of all those improvements we've been making. Stan