Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-Andre Laperle2020-05-10 15:11:11 -0400
committerMarc-André Laperle2020-07-11 17:28:56 -0400
commitd017917f3584c4bdc06f77a58159918124b0a2c2 (patch)
tree2dc7ca3f3f8c1c9f3a5fd089d97f0e3cd983342d /build/org.eclipse.cdt.managedbuilder.core/src/org
parent063301deca2976648fb6878dbc45eaa27e3f9915 (diff)
downloadorg.eclipse.cdt-d017917f3584c4bdc06f77a58159918124b0a2c2.tar.gz
org.eclipse.cdt-d017917f3584c4bdc06f77a58159918124b0a2c2.tar.xz
org.eclipse.cdt-d017917f3584c4bdc06f77a58159918124b0a2c2.zip
Bug 563006 - CDB settings provider/parser doesn't support "arguments"
One flaw with this implementation is that the "arguments" coming from the CDB do not have shell quoting and shell escaping of quotes whereas the current implementations of Build Output parsers assume some form of shell quoting. This means that simply joining strings of arguments with spaces will be missing the expected shell quoting and possibly misparsed by the build output parsers. It is not clear to be at this point if this should be fixed or not as it might involve revamping the existing build output parsers to add the concept of shell/environment and this could also affect potential extenders. In this current form, simple cases with no spacing and quote escaping involved work correctly and is still a nice improvement. Change-Id: Ia81796e63c748318b34696998ac4a467712e5f96 Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core/src/org')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java7
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java4
2 files changed, 10 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
index 3bc795e6399..008b05e9c11 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
@@ -308,7 +308,12 @@ public class CompilationDatabaseParser extends LanguageSettingsSerializableProvi
}
}
- outputParser.processLine(c.getCommand());
+ String command = c.getCommand();
+ if (command != null) {
+ outputParser.processLine(command);
+ } else if (c.getArguments() != null) {
+ outputParser.processLine(String.join(" ", c.getArguments())); //$NON-NLS-1$
+ }
parseCmdsMonitor.worked(1);
}
LanguageSettingsStorage storage = outputParser.copyStorage();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
index 3675d94dc07..fa58863dee4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompileCommand.java
@@ -18,6 +18,7 @@ public class CompileCommand {
public String directory;
public String command;
public String file;
+ public String[] arguments;
public String getDirectory() {
return directory;
@@ -31,4 +32,7 @@ public class CompileCommand {
return file;
}
+ public String[] getArguments() {
+ return arguments;
+ }
}

Back to the top