From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4523 invoked by alias); 11 Dec 2010 05:55:26 -0000 Received: (qmail 4514 invoked by uid 22791); 11 Dec 2010 05:55:25 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Dec 2010 05:55:20 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 27AD02BAB40; Sat, 11 Dec 2010 00:55:19 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i1A5vaFdoPHO; Sat, 11 Dec 2010 00:55:19 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A6D022BAB63; Sat, 11 Dec 2010 00:55:18 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 9A800145B58; Sat, 11 Dec 2010 06:55:10 +0100 (CET) Date: Sat, 11 Dec 2010 05:55:00 -0000 From: Joel Brobecker To: Stan Shebs Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Print trace state variables Message-ID: <20101211055510.GE2596@adacore.com> References: <4D015A4A.7040500@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D015A4A.7040500@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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-12/txt/msg00161.txt.bz2 > This has been in CodeSourcery's version for some time, but I set it > aside for awhile because it seemed a little kludgy to add a > tracepoint-specific case into general evaluation. I think a cleaner way of doing this would be to create a new OP_ enum for tracepoint variables. We'd then add handling for it in write_dollar_variable, as well as in the expression evaluator. One potential issue with that approach is that it might require each language to also add handling for that operator, but if all languages are implemented the way Ada is (for operators that do not need to be handled specifically in Ada, we default to the standard evaluator (evaluate_subexp_standard or something like this). Another potential issue to consider is precedence: If the user had already defined an internal variable called "VAR", and then creates a tracepoint variable with the same name, which one should we print when he write "$VAR"? With your proposal, the tracepoint variable hides the internal variable, right? One question that worries me: What if the user tries to assign to an internal variable which collides with one of the tracepoint variables, and then tries to print it? I think he'll see the tracepoint variable value, which will make it look like as if his assignment had no effect. > 2010-12-08 Stan Shebs > > * value.c (value_of_internalvar): Add case for trace state > variables. > > * gdb.trace/tsv.exp: Test print command on trace state variables. No objection to this, though, since it is relatively contained. -- Joel