aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-03-01 16:58:57 (EST)
committerRoland Grunberg2013-03-01 17:21:44 (EST)
commit19e9bf1b29d5d70f18c21071f499b738f8dd0558 (patch)
tree0379d40ece9ad486bed56ce75e09fa70e83c41ba
parentf3ad4663d59cef6627db40f3c640d05fe90c321d (diff)
downloadorg.eclipse.linuxtools-19e9bf1b29d5d70f18c21071f499b738f8dd0558.zip
org.eclipse.linuxtools-19e9bf1b29d5d70f18c21071f499b738f8dd0558.tar.gz
org.eclipse.linuxtools-19e9bf1b29d5d70f18c21071f499b738f8dd0558.tar.bz2
Bug 402191: Fix for Perf failing when obtaining source line numbersrefs/changes/93/10793/2
Catch number format exception and leave line number as -1 when "?" is encountered. Change-Id: I30f430c759a76dd48eb3f5c94467e10854440d74 Reviewed-on: https://git.eclipse.org/r/10793 Reviewed-by: Roland Grunberg <rgrunber@redhat.com> IP-Clean: Roland Grunberg <rgrunber@redhat.com> Tested-by: Roland Grunberg <rgrunber@redhat.com>
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
index 0b85080..7c88a8a 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
@@ -647,7 +647,13 @@ public class PerfCore {
//if (PerfPlugin.DEBUG_ON) System.err.println("Parsed line ref without being in valid block, shouldn't happen.");
break;
} else {
- currentSym.addPercent(Integer.parseInt(items[1]), percent);
+ int lineNum = -1;
+ try {
+ lineNum = Integer.parseInt(items[1]);
+ } catch (NumberFormatException e) {
+ // leave line number as -1
+ }
+ currentSym.addPercent(lineNum, percent);
// Symbol currently in 'Unfiled Symbols' but we now know the actual parent
if (currentSym.getParent().getName().equals(PerfPlugin.STRINGS_UnfiledSymbols)) {
currentSym.getParent().removeChild(currentSym);