From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15908 invoked by alias); 13 Nov 2013 17:54:57 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 15815 invoked by uid 48); 13 Nov 2013 17:54:53 -0000 From: "jistone at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/16165] @perf operator in error msgs is corrupted Date: Wed, 13 Nov 2013 17:54:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jistone at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q4/txt/msg00205.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16165 Josh Stone changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jistone at redhat dot com --- Comment #4 from Josh Stone --- (In reply to Jonathan Lebon from comment #3) > This is due to the @perf operator getting expanded to the counter symbol > (see dwarf_var_expanding_visitor::visit_perf_op()). The issue is that the > symbol's token content is set to the literal value passed to the @perf > operator. I think this is what should be fixed - I don't see why it should create a new token at all; just reuse the incoming perf_op's tok. In fact, if we could make it so *no one* outside parse.cxx creates new tokens, I think that would be best. The only other time I know this is currently necessary is when synthesizing printfs, because print_format uses tok->content directly. Fix that, and I think you could restrict token::token to parse.cxx for good. > What then happens is that when we try to color the offending token, the > token's content ('a') doesn't match the original source line ('@perf'). > > There are (at least) two possible ways to fix this: > Patch 1. Only color stuff whose contents would match exactly the source line. > Patch 2. Make sure the new token the expanded perf symbol uses has the > original content. > > Not sure what's the right way. Patch 1 is more general in that other things > of this sort will not be colored. On the other hand, patch 2 allows the > '@perf' keyword to get colored, but I'm not entirely sure what other > repercussions replacing the content may have (and whether this is something > done in other places). Patch 3. Don't make a new token: @perf will get colored with no repercussions. :) -- You are receiving this mail because: You are the assignee for the bug.