This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/16165] @perf operator in error msgs is corrupted
- From: "jistone at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Wed, 13 Nov 2013 17:54:53 +0000
- Subject: [Bug translator/16165] @perf operator in error msgs is corrupted
- Auto-submitted: auto-generated
- References: <bug-16165-6586 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=16165
Josh Stone <jistone at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jistone at redhat dot com
--- Comment #4 from Josh Stone <jistone at redhat dot com> ---
(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.