Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2016-09-02 13:39:24 +0000
committerMarc-Andre Laperle2016-09-04 01:05:19 +0000
commit11ff561baefe518682a578d099ce7725b1b2df3d (patch)
tree097711e4f4883f84f73cc673099bc6f7985be983
parent2403b66bbb566944e0875503078b9e9f3a5f8808 (diff)
downloadorg.eclipse.cdt-11ff561baefe518682a578d099ce7725b1b2df3d.tar.gz
org.eclipse.cdt-11ff561baefe518682a578d099ce7725b1b2df3d.tar.xz
org.eclipse.cdt-11ff561baefe518682a578d099ce7725b1b2df3d.zip
lldb: Fix parsing of some version formats
Change-Id: Ifd8130f4ef97698cbdd0321a1b6644726165f131 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> (cherry picked from commit 3427065e65803cffe1e75a413da893b8313904d5)
-rw-r--r--llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java
index a5ec7f02c32..7dfe254953f 100644
--- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java
+++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/launching/LLDBLaunch.java
@@ -46,8 +46,8 @@ public class LLDBLaunch extends GdbLaunch {
private static final String XCODE_HINT = "(Xcode 7.3.1)"; //$NON-NLS-1$
private static final IntegerTuple LLDB_MINIMUM_REVISION = new IntegerTuple(350, 0, 21, 9);
private static final IntegerTuple LLDB_MINIMUM_VERSION = new IntegerTuple(3, 8, 0);
- private static final Pattern LLDB_VERSION_PATTERN = Pattern.compile("lldb\\s*version\\s*(\\d+)\\.(\\d+)\\.(\\d+).*"); //$NON-NLS-1$ ;
- private static final Pattern LLDB_REVISION_PATTERN = Pattern.compile("lldb-(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d)+)?"); //$NON-NLS-1$
+ private static final Pattern LLDB_VERSION_PATTERN = Pattern.compile("lldb\\s*version\\s*(\\d+)\\.(\\d+)\\.(\\d+).*", Pattern.DOTALL); //$NON-NLS-1$ ;
+ private static final Pattern LLDB_REVISION_PATTERN = Pattern.compile("lldb-(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d)+)?.*", Pattern.DOTALL); //$NON-NLS-1$
private IntegerTuple fLldbVersion;
private IntegerTuple fLldbRevision;
@@ -298,7 +298,7 @@ public class LLDBLaunch extends GdbLaunch {
// LLVM build: lldb-360.99.0
Matcher matcher = LLDB_REVISION_PATTERN.matcher(versionOutput);
- if (!matcher.find()) {
+ if (!matcher.matches()) {
return null;
}
@@ -306,9 +306,13 @@ public class LLDBLaunch extends GdbLaunch {
Integer major = Integer.valueOf(matcher.group(1));
Integer minor = Integer.valueOf(matcher.group(2));
Integer micro = Integer.valueOf(matcher.group(3));
- Integer patch = matcher.groupCount() < 5 ? null : Integer.valueOf(matcher.group(5));
- IntegerTuple revision = new IntegerTuple(major, minor, micro, patch);
- return revision;
+ String patchGroup = matcher.group(5);
+ if (patchGroup != null) {
+ Integer patch = Integer.valueOf(patchGroup);
+ return new IntegerTuple(major, minor, micro, patch);
+ } else {
+ return new IntegerTuple(major, minor, micro);
+ }
} catch (NumberFormatException e) {
LLDBCorePlugin.log(e);
}

Back to the top