From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22136 invoked by alias); 14 Dec 2010 16:13:56 -0000 Received: (qmail 21856 invoked by uid 22791); 14 Dec 2010 16:13:53 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Tue, 14 Dec 2010 16:13:48 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBEGDGqp014312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Dec 2010 11:13:16 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBEGDGZn028896; Tue, 14 Dec 2010 11:13:16 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id oBEGDFLh024606; Tue, 14 Dec 2010 11:13:15 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 1F3FC37848F; Tue, 14 Dec 2010 09:13:15 -0700 (MST) From: Tom Tromey To: Joel Brobecker Cc: Stan Shebs , gdb-patches@sourceware.org Subject: Re: [PATCH] Print trace state variables References: <4D015A4A.7040500@codesourcery.com> <20101211055510.GE2596@adacore.com> Date: Tue, 14 Dec 2010 16:13:00 -0000 In-Reply-To: <20101211055510.GE2596@adacore.com> (Joel Brobecker's message of "Sat, 11 Dec 2010 09:55:10 +0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00233.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> I think a cleaner way of doing this would be to create a new OP_ enum Joel> for tracepoint variables. We'd then add handling for it in Joel> write_dollar_variable, as well as in the expression evaluator. FWIW, I mildly prefer the current approach. Using a new OP_ means that the variable is fixed at expression-parse time; but there doesn't seem to be a compelling need to make this limitation. In fact, it seems like it could be confusing... breakpoint conditions entered at different times would refer to different variables (some hidden!), or re-parsing an expression might resolve the variable differently. Joel> Another potential issue to consider is precedence: If the user had Joel> already defined an internal variable called "VAR", and then creates Joel> a tracepoint variable with the same name, which one should we print Joel> when he write "$VAR"? With your proposal, the tracepoint variable Joel> hides the internal variable, right? The docs say: Trace state variables share the same namespace as other "$" variables, which means that you cannot have trace state variables with names like `$23' or `$pc', nor can you have a trace state variable and a convenience variable with the same name. Maybe this could be enforced? Or is that not possible? Tom