public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: pmachata@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Support periods in ftrace symbol names
Date: Fri, 20 Jun 2008 14:37:00 -0000	[thread overview]
Message-ID: <20080620143751.17722.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  99f1e6c3225f69f6559e33ed19a00eb2e01ca745 (commit)
      from  c69c6ceede39e0ffa06f94321447a25e0d0e2b4d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 99f1e6c3225f69f6559e33ed19a00eb2e01ca745
Author: Petr Machata <pmachata@redhat.com>
Date:   Fri Jun 20 16:37:27 2008 +0200

    Support periods in ftrace symbol names
    
    * Not possible for C expressions, otherwise #MAIN#a.b would become a pain
      to write.  In ftrace we don't care about expressions, and periods are
      occasionally used in low-level symbol names (e.g. __i686.get_pc_thunk.bx)
    * So glob for "all symbols with period" is *.* -- MS-DOS anyone?

-----------------------------------------------------------------------

Summary of changes:
 frysk-core/frysk/expr/CExpr.g            |    2 +-
 frysk-core/frysk/expr/ChangeLog          |   10 +++++++
 frysk-core/frysk/expr/FQIdentParser.java |   39 ++++++++++++++++++-----------
 3 files changed, 35 insertions(+), 16 deletions(-)

First 500 lines of diff:
diff --git a/frysk-core/frysk/expr/CExpr.g b/frysk-core/frysk/expr/CExpr.g
index 0f528be..2654a89 100644
--- a/frysk-core/frysk/expr/CExpr.g
+++ b/frysk-core/frysk/expr/CExpr.g
@@ -416,7 +416,7 @@ tokens
 
 {
     final FQIdentParser fqIdParser
-        = new FQIdentParser(this, true, false, true);
+        = new FQIdentParser(this, true, false, true, false);
 }
 
 AMPERSAND       : '&' ;
diff --git a/frysk-core/frysk/expr/ChangeLog b/frysk-core/frysk/expr/ChangeLog
index 2257a31..9816cdf 100644
--- a/frysk-core/frysk/expr/ChangeLog
+++ b/frysk-core/frysk/expr/ChangeLog
@@ -1,3 +1,13 @@
+2008-06-20  Petr Machata  <pmachata@redhat.com>
+
+	* FQIdentParser.java (ctor): Take extra argument
+	allowPeriodInSymbol.
+	(parseFtraceIdentifier): Pass true for the new argument.
+	(parseFQIdentifier): Likewise.
+	(symbolPattern, globPattern): Unstatic.
+	(symbolRe): Kill.
+	* CExpr.g (fqIdParser): Pass false for the new argument.
+
 2008-06-13  Petr Machata  <pmachata@redhat.com>
 
 	* FQIdentParser.java (containsGlobChar): Rename to
diff --git a/frysk-core/frysk/expr/FQIdentParser.java b/frysk-core/frysk/expr/FQIdentParser.java
index de521f9..2aa9ce2 100644
--- a/frysk-core/frysk/expr/FQIdentParser.java
+++ b/frysk-core/frysk/expr/FQIdentParser.java
@@ -70,17 +70,8 @@ public class FQIdentParser {
     private final boolean allowGlobs;
     private final boolean expectMoreTokens;
 
-    // This pattern deliberately doesn't check for initial letter.
-    // Relevant code checks this explicitly.  This way, if user makes
-    // a mistake and writes e.g. something#123+b, we recognize "123"
-    // as a typo, while leaving out the part after a "+", which is
-    // certainly irrelevant.
-    final static String symbolRe = "[a-zA-Z0-9_$]+";
-
-    private final static Pattern symbolPattern = Pattern.compile(symbolRe);
-    private final static Pattern globPattern
-	= Pattern.compile("(\\[(\\^?\\][^\\]]*|\\^[^\\]]+|[^^\\]][^\\]]*|\\^?\\[:[^:]+:\\])\\]|"
-			  + symbolRe + "|\\*)+");
+    private final Pattern symbolPattern;
+    private final Pattern globPattern;
 
     /**
      * @param allowDynamic Whether the [pid.tid#frame] portion of the
@@ -101,12 +92,28 @@ public class FQIdentParser {
     FQIdentParser(CharScanner scanner,
 		  boolean allowDynamic,
 		  boolean allowGlobs,
-		  boolean expectMoreTokens) {
+		  boolean expectMoreTokens,
+		  boolean allowPeriodInSymbol) {
 
 	this.scanner = scanner;
 	this.allowDynamic = allowDynamic;
 	this.allowGlobs = allowGlobs;
 	this.expectMoreTokens = expectMoreTokens;
+
+	// This pattern deliberately doesn't check for initial letter.
+	// Relevant code checks this explicitly.  This way, if user makes
+	// a mistake and writes e.g. something#123+b, we recognize "123"
+	// as a typo, while leaving out the part after a "+", which is
+	// certainly irrelevant.
+	String symbolRe = "[a-zA-Z0-9_$" + (allowPeriodInSymbol
+					    ? "." : "") + "]+";
+	this.symbolPattern = Pattern.compile(symbolRe);
+	this.globPattern
+	    = Pattern.compile("(\\[(\\^?\\][^\\]]*" +  // handles []abc] and [^]abc]
+			      "|\\^[^\\]]+" +          // handles [^abc]
+			      "|[^^\\]][^\\]]*" +      // handles [abc], and [ab^c] (cases where ^ isn't an operator)
+			      "|\\^?\\[:[^:]+:\\]"+    // handles [[:abc:]] and [^[:abc:]]
+			      ")\\]|" + symbolRe + "|\\*)+");
     }
 
     private char fqLA(int i) throws CharStreamException {
@@ -383,7 +390,8 @@ public class FQIdentParser {
     parseFQIdentifier(String str,
 		      boolean allowDynamic,
 		      boolean allowGlobs,
-		      boolean expectMoreTokens)
+		      boolean expectMoreTokens,
+		      boolean allowPeriodInSymbol)
         throws ExtraGarbageException, InvalidTokenException
     {
         try {
@@ -395,7 +403,8 @@ public class FQIdentParser {
 		};
 	    FQIdentParser parser
 		= new FQIdentParser(scanner, allowDynamic,
-				    allowGlobs, expectMoreTokens);
+				    allowGlobs, expectMoreTokens,
+				    allowPeriodInSymbol);
 	    FQIdentToken tok = parser.parse("");
 
 	    if (scanner.LA(1) != CharScanner.EOF_CHAR)
@@ -415,6 +424,6 @@ public class FQIdentParser {
     public static FQIdentifier parseFtraceIdentifier(String str)
         throws ExtraGarbageException, InvalidTokenException
     {
-	return parseFQIdentifier(str, false, true, false);
+	return parseFQIdentifier(str, false, true, false, true);
     }
 }


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2008-06-20 14:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080620143751.17722.qmail@sourceware.org \
    --to=pmachata@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).