From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12524 invoked by alias); 12 Sep 2014 19:45:21 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 12514 invoked by uid 89); 12 Sep 2014 19:45:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailuogwhop.emc.com Received: from mailuogwhop.emc.com (HELO mailuogwhop.emc.com) (168.159.213.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 12 Sep 2014 19:45:18 +0000 Received: from maildlpprd04.lss.emc.com (maildlpprd04.lss.emc.com [10.253.24.36]) by mailuogwprd04.lss.emc.com (Sentrion-MTA-4.3.0/Sentrion-MTA-4.3.0) with ESMTP id s8CJjF5Y008691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 12 Sep 2014 15:45:16 -0400 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd04.lss.emc.com s8CJjF5Y008691 X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd04.lss.emc.com s8CJjF5Y008691 Received: from mailhub.lss.emc.com (mailhubhoprd03.lss.emc.com [10.254.221.145]) by maildlpprd04.lss.emc.com (RSA Interceptor) for ; Fri, 12 Sep 2014 15:44:45 -0400 Received: from usendtaylorx2l.lss.emc.com (usendtaylorx2l.lss.emc.com [10.243.10.188]) by mailhub.lss.emc.com (Switch-3.4.3/Switch-3.4.3) with ESMTP id s8CJj65w021576 for ; Fri, 12 Sep 2014 15:45:06 -0400 Received: by usendtaylorx2l.lss.emc.com (Postfix, from userid 26043) id 9309B5D2F47; Fri, 12 Sep 2014 15:45:03 -0400 (EDT) Received: from usendtaylorx2l (localhost [127.0.0.1]) by usendtaylorx2l.lss.emc.com (Postfix) with ESMTP id E94C45D1569 for ; Fri, 12 Sep 2014 15:45:03 -0400 (EDT) From: David Taylor To: gdb@sourceware.org Subject: trace state variables -- what should be traced? Date: Fri, 12 Sep 2014 19:45:00 -0000 Message-ID: <32355.1410551103@usendtaylorx2l> X-EMM-MHVC: 1 X-RSA-Classifications: public X-Sentrion-Hostname: mailuogwprd04.lss.emc.com X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00048.txt.bz2 For trace state variables, what should be traced? If I reference a trace state variable in a tracepoint action, its value will be collected and placed into the trace frame. If it's not a trace state variable, but rather just an 'ordinary' variable, then there is, currently, no ambiguity. But, for trace state variables, it can be set with an aop_setv operation. Which value should be recorded? The old value? Or the new value? Currently the new value is always recorded and sometimes the old value is recorded as well. Since the old value, when it is recorded, is always recorded prior to recording the new value, the new value overwrites the old value. The manual doesn't say what happens, but I would argue that the old value should always be recorded and never the new value. Thoughts? Knowing the collection expression and the values of everything in it allows me to compute the new value. But, I cannot similarly compute the old value. Once it is overwritten it is lost forever. There are 4 places where aop_tracev is generated, all 4 are in gdb/ax-gdb.c, function gen_expr. case BINOP_ASSIGN: ax_tsv (ax, aop_setv, tsv->number); if (ax->tracing) ax_tsv (ax, aop_tracev, tsv->number); case BINOP_ASSIGN_MODIFY: ax_tsv (ax, aop_getv, tsv->number); if (ax->tracing) ax_tsv (ax, aop_tracev, tsv->number); and then a little bit later in that same case: ax_tsv (ax, aop_setv, tsv->number); if (ax->tracing) ax_tsv (ax, aop_tracev, tsv->number); case OP_INTERNALVAR: ax_tsv (ax, aop_getv, tsv->number); if (ax->tracing) ax_tsv (ax, aop_tracev, tsv->number); If you agree, then the first (BINOP_ASSIGN) should have the setv moved after the tracev to become: if (ax->tracing) ax_tsv (ax, aop_tracev, tsv->number); ax_tsv (ax, aop_setv, tsv->number); and the third (second one in BINOP_ASSIGN_MODIFY) should have the if (ax->tracing) ax_tsv (ax, aop_tracev, tsv->number); lines deleted. Comments? David