aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Meng2014-01-09 14:17:17 (EST)
committerRoland Grunberg2014-01-10 15:16:22 (EST)
commitc241e7ff58351b4a447a0b94016c99682479ead4 (patch)
treec25adc775dcbfc50e2db4b837feeeb9dd98dcd7c
parentdae7999d7ef2e1d9592ab518e52c44bc08be9130 (diff)
downloadorg.eclipse.linuxtools-c241e7ff58351b4a447a0b94016c99682479ead4.zip
org.eclipse.linuxtools-c241e7ff58351b4a447a0b94016c99682479ead4.tar.gz
org.eclipse.linuxtools-c241e7ff58351b4a447a0b94016c99682479ead4.tar.bz2
423371: Improve ValgrindCoreParser to handle custom format.refs/changes/60/20460/2
Change-Id: If757f248cfcc64b0b2b6e0f6f0e278cf18175ae5 Signed-off-by: David Meng <dmeng@blackberry.com> Reviewed-on: https://git.eclipse.org/r/20460 Tested-by: Hudson CI Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCoreParser.java3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/valgrind/core/ValgrindParserUtils.java14
2 files changed, 14 insertions, 3 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCoreParser.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCoreParser.java
index f54cd5a..0e35af3 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCoreParser.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCoreParser.java
@@ -44,7 +44,8 @@ public class ValgrindCoreParser {
while ((line = br.readLine()) != null) {
// remove PID string
// might encounter warnings also #325130
- line = line.replaceFirst("==\\d+==|\\*\\*\\d+\\*\\*", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ // fixed #423371 - handle timestamp (e.g. ==00:00:00:01.175 52756728==)
+ line = line.replaceFirst("==([\\d:\\.]+\\s)?\\d+==|\\*\\*\\d+\\*\\*", ""); //$NON-NLS-1$ //$NON-NLS-2$
int indent;
for (indent = 0; indent < line.length()
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/valgrind/core/ValgrindParserUtils.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/valgrind/core/ValgrindParserUtils.java
index 62d1afd..c717e3e 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/valgrind/core/ValgrindParserUtils.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/valgrind/core/ValgrindParserUtils.java
@@ -108,8 +108,8 @@ public final class ValgrindParserUtils {
}
/**
- * Parses string ending with format ([FILE]:[LINE])
- * Assumes syntax is: "\(.*:[0-9]+\)$"
+ * Parses string ending with format ([FILE]:[LINE MODULE])
+ * Assumes syntax is: "\(.*:[0-9]+(\s.+)?\)$"
* @param line - String with the above criteria
* @return a tuple of [String filename, Integer line]
*/
@@ -126,6 +126,16 @@ public final class ValgrindParserUtils {
if (isNumber(strLineNo)) {
lineNo = Integer.parseInt(strLineNo);
filename = part.substring(0, ix);
+ } else {
+ // handle format: (FILE:LINE MODULE)
+ int ix1 = strLineNo.indexOf(" "); //$NON-NLS-1$
+ if (ix1 > 0) {
+ strLineNo = strLineNo.substring(0, ix1);
+ if (isNumber(strLineNo)) {
+ lineNo = Integer.parseInt(strLineNo);
+ filename = part.substring(0, ix);
+ }
+ }
}
}
else {