Bug 4846 - change $1..$n to character pasting
Summary: change $1..$n to character pasting
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-26 14:12 UTC by Frank Ch. Eigler
Modified: 2007-08-08 03:36 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2007-07-26 14:12:45 UTC
At this time, $1 substitution works by parsing a command line argument as a
number and pasting that number token into the script.  @1 turns it into a string
literal token.  There is no way to paste plain old characters, to do this:
   probe syscall.$1 { }
So, let's change things:

@1 would be redefined/clarified to paste a double-quoted (and internally
\-escaped) sequence of characters; $1 would be redefined to paste the command
line arguments verbatim.  In each case, these would paste characters right
into the lexer input stream.  (Numeric parsing for $N would be left to the
ordinary tokenizer.)

Existing scripts that use $1/@1 should actually be unaffected by this.
Comment 1 Frank Ch. Eigler 2007-08-08 03:36:53 UTC
patch committed