summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2010-02-19 17:45:50 -0500
committerFrank Ch. Eigler <fche@elastic.org>2010-02-19 17:45:50 -0500
commit489e3d510e3ed9bf4e3388084cc4de6e2749576a (patch)
tree3c9f0cc91b584e138ce39f37cfd15d5b62b0f43a
parent83b38ce6107fc90de79e14edc0fea29d6dec7724 (diff)
downloadsystemtap-steved-489e3d510e3ed9bf4e3388084cc4de6e2749576a.tar.gz
systemtap-steved-489e3d510e3ed9bf4e3388084cc4de6e2749576a.tar.xz
systemtap-steved-489e3d510e3ed9bf4e3388084cc4de6e2749576a.zip
PR11208: glue adjacent string literals together.
* parse.cxx (lexer::scan): Glue adjacent strings together. * testsuite/parseko/twentyseven.stp, semok/thirtyfive.stp: New tests.
-rw-r--r--NEWS13
-rw-r--r--parse.cxx14
-rwxr-xr-xtestsuite/parseko/twentyseven.stp4
-rwxr-xr-xtestsuite/semok/thirtyfive.stp8
4 files changed, 37 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 82aa205f..8d9fe2bf 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,18 @@
* What's new
+
+- Adjacent string literals are glued together, making this
+ construct valid:
+ probe process("/usr" @1 "/bin").function("*") { ... }
+
- In order to limit potential impact from future security problems,
the stap-server process does not permit its being launched as root.
-- New : systemtap now supports probes for Hardware Breakpoints on x86
- and x86_64. For syntax details, see man page for stapprobes.
+- On recent kernels, for some architectures/configurations, hardware
+ breakpoint probes are supported. The probe point syntax is:
+
+ probe kernel.data(ADDRESS).write
+ probe kernel.data(ADDRESS).length(LEN).write
+ probe kernel.data("SYMBOL_NAME").write
* What's new in version 1.1
diff --git a/parse.cxx b/parse.cxx
index ad4f93f0..f99a440b 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -885,6 +885,7 @@ skip:
else if (c == '\"')
{
n->type = tok_string;
+ another_string:
while (1)
{
c = input_get ();
@@ -924,6 +925,19 @@ skip:
else
n->content.push_back(c);
}
+ // PR11208: check if the next token is also a string literal; auto-concatenate it
+ // This is complicated to the extent that we need to skip intermediate whitespace.
+ // XXX: but not comments
+ unsigned nspace = 0;
+ do {
+ c = input_peek(nspace++);
+ if (c == '\"') // new string literal?
+ {
+ // consume all whitespace plus the opening quote
+ while (nspace-- > 0) input_get();
+ goto another_string; // and append the rest to this token
+ }
+ } while (isspace(c));
return n;
}
diff --git a/testsuite/parseko/twentyseven.stp b/testsuite/parseko/twentyseven.stp
new file mode 100755
index 00000000..39c9224a
--- /dev/null
+++ b/testsuite/parseko/twentyseven.stp
@@ -0,0 +1,4 @@
+#! stap -p1
+
+# PR 11208
+probe kernel.function ("sys_" /* this comment prevents string gluing */ "open") {}
diff --git a/testsuite/semok/thirtyfive.stp b/testsuite/semok/thirtyfive.stp
new file mode 100755
index 00000000..325c90fb
--- /dev/null
+++ b/testsuite/semok/thirtyfive.stp
@@ -0,0 +1,8 @@
+#! stap -p2
+
+// PR11208
+probe kernel.function("sys""_""open") {}
+probe kernel.function("sys" "_" "close") {}
+probe kernel.function("p"
+ "a" "n" "i"
+ "c") {}