From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28657 invoked by alias); 8 Aug 2011 23:02:32 -0000 Received: (qmail 28646 invoked by uid 22791); 8 Aug 2011 23:02:31 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from elasmtp-junco.atl.sa.earthlink.net (HELO elasmtp-junco.atl.sa.earthlink.net) (209.86.89.63) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 23:02:15 +0000 Received: from [70.170.59.51] (helo=macbook2.local) by elasmtp-junco.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1QqYpq-000280-Le for gdb-patches@sourceware.org; Mon, 08 Aug 2011 19:02:14 -0400 Message-ID: <4E406AE9.100@earthlink.net> Date: Mon, 08 Aug 2011 23:02:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [PATCH]tracepoint.c: Add conditionals num to find_matching_tracepoint References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ELNK-Trace: ae6f8838ff913eba0cc1426638a40ef67e972de0d01da940a666aba012f17b8f1e5115c6d80aecde350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c 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/msg00161.txt.bz2 On 8/7/11 9:28 AM, Hui Zhu wrote: > Hi, > > I found that when I set some tracepoint to a same address, and use > tsave. And use "target tfile " to open it. It will only one > tracepoint available. > And output some words like: > Created tracepoint 1 for target's tracepoint 1 at 0x40050a. > Assuming tracepoint 1 is same as target's tracepoint 2 at 0x40050a. > Assuming tracepoint 1 is same as target's tracepoint 3 at 0x40050a. > > This is because find_matching_tracepoint didn't check the num. The number is exactly the one property that tracepoint upload must never consider when looking for matching tracepoints, since the numbers vary depending on what the user has been doing during the current GDB session. Addressing the FIXME will help the multiple-tracepoint case, although it's kind of messy. There is another useful heuristic that would be easy to add, which is to exclude matching on a tracepoint that has already been uploaded. Having created tracepoint 1 from the uploaded info, it's never going to be the case that uploaded tracepoints 2 and 3 are the same as 1. It might be as simple as testing number_on_target, but beware that it might be nonzero due to other trace runs or some such. Stan stan@codesourcery.com > > And I think the tracepoint have the same address is really helpful for > user. Because we can set different condition to make tracepoint more > powerful. > So I make following patch. > > Please help me review it. > > Thanks, > Hui > > > 2011-08-08 Hui Zhu > > * tracepoint.c (find_matching_tracepoint): Add number check.