From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14388 invoked by alias); 5 May 2011 17:48:12 -0000 Received: (qmail 14377 invoked by uid 22791); 5 May 2011 17:48:11 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 17:47:56 +0000 Received: (qmail 28510 invoked from network); 5 May 2011 17:47:55 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 May 2011 17:47:55 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] Support for enabling/disabling tracepoints while a trace experiment is running Date: Thu, 05 May 2011 17:48:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: Kwok Cheung Yeung References: <4DC2DDEF.10600@codesourcery.com> In-Reply-To: <4DC2DDEF.10600@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105051848.15560.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: 2011-05/txt/msg00149.txt.bz2 On Thursday 05 May 2011 18:27:11, Kwok Cheung Yeung wrote: > * gdbserver/tracepoint.c (clear_installed_tracepoints): Uninstall > disabled tracepoints. gdbserver has its own gdbserver/ChangeLog file: * tracepoint.c (clear_installed_tracepoints): Uninstall disabled tracepoints. > * NEWS: Add news item for the new behaviour of the enable and disable > GDB commands when applied to tracepoints. > Add news items for the new remote packets QTEnable and QTDisable. > > gdb/doc/ > * gdb.texinfo: Document change in the behaviour of the enable and > disable GDB commands when applied to tracepoints. > Document QTEnable and QTDisable in the list of tracepoint packets. Eli is our documentation maintainer and will review these bits. The code looks okay to me. > static void > +cmd_qtenable_disable (char *own_buf, int enable) > +{ > + char *packet = own_buf; > + ULONGEST num, addr; > + struct tracepoint *tp; > + > + packet += strlen (enable ? "QTEnable:" : "QTDisable:"); > + packet = unpack_varlen_hex (packet, &num); > + ++packet; /* skip a colon */ > + packet = unpack_varlen_hex (packet, &addr); > + > + tp = find_tracepoint (num, addr); > + > + if (tp) > + { > + if ((enable && tp->enabled) || (!enable && !tp->enabled)) but isn't this just: if (enable != tp->enabled) ? > + { > + trace_debug ("Tracepoint %d at 0x%s is already %s", > + (int) num, paddress (addr), > + enable ? "enabled" : "disabled"); > + write_ok (own_buf); > + return; > + } > + -- Pedro Alves