From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24338 invoked by alias); 28 Jun 2010 20:04:29 -0000 Received: (qmail 24312 invoked by uid 22791); 28 Jun 2010 20:04:27 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Jun 2010 20:04:23 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0L4Q00F00QC20600@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Mon, 28 Jun 2010 23:03:46 +0300 (IDT) Received: from HOME-C4E4A596F7 ([77.126.255.236]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L4Q00AB6QE954D0@a-mtaout23.012.net.il>; Mon, 28 Jun 2010 23:03:46 +0300 (IDT) Date: Mon, 28 Jun 2010 20:04:00 -0000 From: Eli Zaretskii Subject: Re: Static tracepoints support In-reply-to: <201006281326.39820.pedro@codesourcery.com> To: Pedro Alves Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83hbkmc481.fsf@gnu.org> References: <201006251931.57860.pedro@codesourcery.com> <83tyoqcc8i.fsf@gnu.org> <201006281326.39820.pedro@codesourcery.com> 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: 2010-06/txt/msg00658.txt.bz2 > From: Pedro Alves > Date: Mon, 28 Jun 2010 13:26:38 +0100 > > > > +/* When symbols change, it probably means the sources changed as well, > > > + and it might mean the static tracepoint markers are no longer at > > > + the same address or line numbers they used to be at last we > > > + checked. Losing your static tracepoints whenever you rebuild is > > > + undesirable. This function tries to resync/rematch gdb static > > > + tracepoints with the markers on the target. The heuristic is: > > > + > > > + 1) look for a marker at the old PC. If one is found there, assume > > > + to be the same marker. If the name / string id of the marker found > > > + is different from the previous known name, assume that means the > > > + user renamed the marker in the sources, and output a warning. > > > + > > > + 2) If a marker is no longer found at the same address, it may mean > > > + the marker no longer exists. But it may also just mean the code > > > + changed a bit. Maybe the user added a few lines of code that made > > > + the marker move up or down (in line number terms). Ask the target > > > + for info about the marker with the string id as we knew it. If > > > + found, update line number and address in the matching static > > > + tracepoint. */ > > > > I would suggest to reverse the order of the steps: first to query the > > target about the marker with the old string ID, and only if it is not > > found, use the heuristics in step 1. The rationale is that if the > > target can provide the info, it is always more reliable than any > > heuristics. You didn't respond to this part. I'm curious to hear your opinion on why it is TRT the way you coded it.