From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12552 invoked by alias); 4 Feb 2013 17:55:26 -0000 Received: (qmail 12533 invoked by uid 22791); 4 Feb 2013 17:55:25 -0000 X-SWARE-Spam-Status: No, hits=-7.6 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; Mon, 04 Feb 2013 17:55:15 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r14HUbSS007930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Feb 2013 12:30:44 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r14HUWJx011808; Mon, 4 Feb 2013 12:30:36 -0500 Message-ID: <510FF037.8000101@redhat.com> Date: Mon, 04 Feb 2013 17:55: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: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] New MI notification "=tsv-modified" References: <1359560580-1970-1-git-send-email-yao@codesourcery.com> <510C27CE.3090102@redhat.com> <510CCE26.50600@codesourcery.com> In-Reply-To: <510CCE26.50600@codesourcery.com> Content-Type: text/plain; charset=UTF-8 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-02/txt/msg00084.txt.bz2 On 02/02/2013 08:28 AM, Yao Qi wrote: > On 02/02/2013 04:38 AM, Pedro Alves wrote: >> Should we emit a notification when GDB detects the target >> changes the variable too? >> > > Yes, we should, but I am still evaluating the pros vs. cons. of using > async remote notification on tsv changes in the target or let GDB to > check the tsv changes. I need more time to get the answer, but in > parallel, I'd like the "=tsv-modified" notification goes in to notify > MI front-end that a tsv is modified by command. Ack. Hmm. This makes me realize that I think all three =tsv notifications should be changed in one aspect. > because "what is the new" is added into the changelog entry in gdb/doc/ChangeLog, don't have to replicate it again in gdb/ChangeLog to mention it again for NEWS. But those are different ChangeLog files. Reading gdb/ChangeLog in isolation should make sense. More below. > Here is the new version below, to address your comments. I don't > insist on my original changelog entry, as either is OK to me. > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 4b51228..b6b0439 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -27954,6 +27954,10 @@ value @var{value}. > Reports that the trace state variable @var{name} is deleted or all > trace state variables are deleted. > > +@item =tsv-modified,name=@var{name},value=@var{value} > +Reports that the trace state variable @var{name} is modified with > +value @var{value}. > +@deftypefun void tsv_modified (const char *@var{name}, LONGEST @var{value}) > +The trace state value @var{name} is modified with value > +@var{value}. > +@end deftypefun _Which_ value is being talked about here is not explicit. Trace state variables have _two_ values. The initial value, and the current value (omitted if doesn't exist yet). If we list tsvs with MI's -trace-list-variables, we'll indeed see an "init" and a "current" attribute, for each tsv, and no attribute named "value". So I think it'd be very good to fix this before the release, and make the output of the notifications consistent with the tsv listing output, and the docs clearer. E.g.: (gdb) interpreter-exec mi "-trace-list-variables" ^done,trace-variables={nr_rows="1",nr_cols="3", hdr=[{width="15",alignment="-1",col_name="name",colhdr="Name"}, {width="11",alignment="-1",col_name="initial",colhdr="Initial"}, {width="11",alignment="-1",col_name="current",colhdr="Current"}], body=[variable={name="$a",initial="1"}, variable={name="$b",initial="2",current="3"}] SO IOW, =tsv-created should be =tsv-created,name=@var{name},initial=@var{value} instead of the current =tsv-created,name=@var{name},value=@var{value} and =tsv-modified should be =tsv-modified,name=@var{name},initial=@var{value} instead of the proposed =tsv-modified,name=@var{name},value=@var{value} Maybe it'd be a good idea to factor out the bits in tvariables_info_1 that dump a tsv into a separate function to use the in modify case as well? We'd also output a "current" attribute as well in the =tsv-modified case, but I'd argue that actually makes sense? Then this is very much like the breakpoint-modified notification, and interface consistency, at all the levels, is good all around. -- Pedro Alves