Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2014-07-03 10:40:45 -0400
committerElena Laskavaia2014-07-15 16:48:21 -0400
commit29b783155fd3acec6c0b5b65237a70fb0e219260 (patch)
tree0802984faf708429265832cf94ac9d11e606a0c5
parent4ec3cdbbe771f13ff308c5701c1fb7f4373a2d38 (diff)
downloadorg.eclipse.cdt-29b783155fd3acec6c0b5b65237a70fb0e219260.tar.gz
org.eclipse.cdt-29b783155fd3acec6c0b5b65237a70fb0e219260.tar.xz
org.eclipse.cdt-29b783155fd3acec6c0b5b65237a70fb0e219260.zip
Bug 408545 - Added single checkbox to enable gcov. (edit commit msg)
I added a checkbox to enable gCov via a single checkbox to enable gcov in the compiler. It then uses the applicability calculator to automatically enable the linker if the compiler option is set. Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com> Change-Id: I561d7263d578a7807e890fce5518e6fc2ebb2bb2 Reviewed-on: https://git.eclipse.org/r/29403 Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com> Tested-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml34
-rw-r--r--build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GcovAppCalculator.java22
3 files changed, 58 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties
index d968835374..af48e63156 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties
@@ -160,6 +160,8 @@ Option.Posix.Verbose=Verbose (-v)
Option.OtherFlags=Other flags
Option.Posix.Ansi=Support ANSI programs (-ansi)
Option.PIC=Position Independent Code (-fPIC)
+Option.codecov=Generate gcov information (-ftest-coverage -fprofile-arcs)
+Option.codecovTip="Check this flag if you want to enable Profile Code Coverage in your application. Remember to enable this option in both the Compiler-&gt; Miscellaneous and Linker -&gt; General. Then rebuild your project and run Code Coverage again."
Option.Posix.Linker.NoStartFiles=Do not use standard start files (-nostartfiles)
Option.Posix.Linker.NoDefLibs=Do not use default libraries (-nodefaultlibs)
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
index e26d5b78c0..784e67955d 100644
--- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml
@@ -220,6 +220,14 @@
name="%Option.Posix.Debug.gprof"
valueType="boolean">
</option>
+ <option
+ applicabilityCalculator="org.eclipse.cdt.managedbuilder.gnu.ui.GcovAppCalculator"
+ command="-ftest-coverage -fprofile-arcs"
+ defaultValue="false"
+ id="gnu.c.link.option.debugging.codecov"
+ name="%Option.codecov"
+ valueType="boolean">
+ </option>
</tool>
<tool
natureFilter="ccnature"
@@ -421,6 +429,14 @@
name="%Option.Posix.Debug.gprof"
valueType="boolean">
</option>
+ <option
+ applicabilityCalculator="org.eclipse.cdt.managedbuilder.gnu.ui.GcovAppCalculator"
+ command="-ftest-coverage -fprofile-arcs"
+ defaultValue="false"
+ id="gnu.cpp.link.option.debugging.codecov"
+ name="%Option.codecov"
+ valueType="boolean">
+ </option>
</tool>
<tool
natureFilter="both"
@@ -1197,6 +1213,15 @@
id="gnu.c.compiler.option.debugging.gprof"
valueType="boolean">
</option>
+ <option
+ category="gnu.c.compiler.category.debug"
+ command="-ftest-coverage -fprofile-arcs"
+ defaultValue="false"
+ id="gnu.c.compiler.option.debugging.codecov"
+ name="%Option.codecov"
+ tip="%Option.codecovTip"
+ valueType="boolean">
+ </option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.c.compiler"
name="%OptionCategory.Warn"
@@ -1566,6 +1591,15 @@
id="gnu.cpp.compiler.option.debugging.gprof"
valueType="boolean">
</option>
+ <option
+ defaultValue="false"
+ name="%Option.codecov"
+ category="gnu.cpp.compiler.category.debug"
+ command="-ftest-coverage -fprofile-arcs"
+ id="gnu.cpp.compiler.option.debugging.codecov"
+ tip="%Option.codecovTip"
+ valueType="boolean">
+ </option>
<optionCategory
owner="cdt.managedbuild.tool.gnu.cpp.compiler"
name="%OptionCategory.Warn"
diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GcovAppCalculator.java b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GcovAppCalculator.java
new file mode 100644
index 0000000000..0b29b52899
--- /dev/null
+++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/src/org/eclipse/cdt/managedbuilder/gnu/ui/GcovAppCalculator.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Red Hat, Inc.
+ *
+ * *Based on implementation of GprofAppCalculator*
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * lufimtse : Leo Ufimtsev lufimtse@redhat.com
+ *******************************************************************************/
+
+package org.eclipse.cdt.managedbuilder.gnu.ui;
+
+public class GcovAppCalculator extends ProfAppCalculator {
+ @Override
+ protected String getOptionIdPattern() {
+ return ".compiler.option.debugging.codecov"; //$NON-NLS-1$
+ }
+}

Back to the top