mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
lldb: Fix parsing of some version formats
Change-Id: Ifd8130f4ef97698cbdd0321a1b6644726165f131 Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This commit is contained in:
parent
f922bfacc6
commit
3427065e65
1 changed files with 10 additions and 6 deletions
|
@ -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 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_REVISION = new IntegerTuple(350, 0, 21, 9);
|
||||||
private static final IntegerTuple LLDB_MINIMUM_VERSION = new IntegerTuple(3, 8, 0);
|
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_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)+)?"); //$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 fLldbVersion;
|
||||||
private IntegerTuple fLldbRevision;
|
private IntegerTuple fLldbRevision;
|
||||||
|
@ -298,7 +298,7 @@ public class LLDBLaunch extends GdbLaunch {
|
||||||
// LLVM build: lldb-360.99.0
|
// LLVM build: lldb-360.99.0
|
||||||
|
|
||||||
Matcher matcher = LLDB_REVISION_PATTERN.matcher(versionOutput);
|
Matcher matcher = LLDB_REVISION_PATTERN.matcher(versionOutput);
|
||||||
if (!matcher.find()) {
|
if (!matcher.matches()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,9 +306,13 @@ public class LLDBLaunch extends GdbLaunch {
|
||||||
Integer major = Integer.valueOf(matcher.group(1));
|
Integer major = Integer.valueOf(matcher.group(1));
|
||||||
Integer minor = Integer.valueOf(matcher.group(2));
|
Integer minor = Integer.valueOf(matcher.group(2));
|
||||||
Integer micro = Integer.valueOf(matcher.group(3));
|
Integer micro = Integer.valueOf(matcher.group(3));
|
||||||
Integer patch = matcher.groupCount() < 5 ? null : Integer.valueOf(matcher.group(5));
|
String patchGroup = matcher.group(5);
|
||||||
IntegerTuple revision = new IntegerTuple(major, minor, micro, patch);
|
if (patchGroup != null) {
|
||||||
return revision;
|
Integer patch = Integer.valueOf(patchGroup);
|
||||||
|
return new IntegerTuple(major, minor, micro, patch);
|
||||||
|
} else {
|
||||||
|
return new IntegerTuple(major, minor, micro);
|
||||||
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
LLDBCorePlugin.log(e);
|
LLDBCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue