From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20371 invoked by alias); 1 Mar 2013 18:31:39 -0000 Received: (qmail 20341 invoked by uid 22791); 1 Mar 2013 18:31:35 -0000 X-SWARE-Spam-Status: No, hits=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Mar 2013 18:31:28 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r21IVPXq009036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Mar 2013 13:31:25 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r21IVN2b002042; Fri, 1 Mar 2013 13:31:24 -0500 Message-ID: <5130F3FB.2050203@redhat.com> Date: Fri, 01 Mar 2013 18:31:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: "Abid, Hafiz" CC: stan@codesourcery.com, gdb-patches@sourceware.org Subject: Re: [patch] remote_set_trace_notes References: <1362159789.18212.1@abidh-ubunto1104> In-Reply-To: <1362159789.18212.1@abidh-ubunto1104> Content-Type: text/plain; charset=ISO-8859-1 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: 2013-03/txt/msg00035.txt.bz2 On 03/01/2013 05:43 PM, Abid, Hafiz wrote: > > Hi All, > During review of trace-buffer-size patch, I was asked to move a change into a separate patch. This is simple change in remote_set_trace_notes that will make this function return if all arguments are NULL. > > 2012-03-01 Stan Shebs > Hafiz Abid Qadeer > > gdb/ > * remote.c (remote_set_trace_notes): Handle no-op case better. Should this really be a no-op? I'm not sure this is correct. Say you connect to a target that had been tracing before (disconnected tracing), and had its trace notes/user/etc. set. GDB connects, the user sets up a new trace session, but doesn't set notes/user/etc. IOW, the (trace_user/trace_notes/etc.) GDB variables are left with their NULL defaults. "show trace-notes" shows: (gdb) show trace-notes The notes string to use for current and future trace runs is "". The user starts the trace session with tstart. With the patch, GDB skips sending "QTNotes:...". The target reuses the user/notes from the previous session. That can't be right. Do the same experiment again, but do (literally) "set trace-notes" before tstart. This sets the trace_notes variable to "" instead of NULL. This time, "tstart" actually clears the previous run's trace notes on the target. Seems to me there's actually a bug here, and NULL and "" should be treated as equivalent by remote_set_trace_notes. -- Pedro Alves