Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-02-06 06:45:22 +0000
committerUwe Stieber2012-02-06 06:45:22 +0000
commit7cf2200d6a24385ceaacefee9b9f8c31a474e740 (patch)
tree161430cae4473be8087b2c2a8b0d8ebfb2395596 /target_explorer/plugins/org.eclipse.tcf.te.core.cdt
parenta34f0562d1979cd73312e32a1ee7dd83dedebe5e (diff)
downloadorg.eclipse.tcf-7cf2200d6a24385ceaacefee9b9f8c31a474e740.tar.gz
org.eclipse.tcf-7cf2200d6a24385ceaacefee9b9f8c31a474e740.tar.xz
org.eclipse.tcf-7cf2200d6a24385ceaacefee9b9f8c31a474e740.zip
Target Explorer: Extract CDT core dependencies into a separate plugin
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.core.cdt')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.classpath7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.options1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.project28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/META-INF/MANIFEST.MF16
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/build.properties5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/plugin.properties12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/pom.xml17
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/activator/CoreBundleActivator.java71
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/elf/ElfUtils.java73
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.java32
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.properties5
12 files changed, 275 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.classpath b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.classpath
new file mode 100644
index 000000000..8a8f1668c
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.options b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.options
new file mode 100644
index 000000000..5f7dba44d
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.options
@@ -0,0 +1 @@
+org.eclipse.tcf.te.core.cdt/debugmode = 0
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.project b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.project
new file mode 100644
index 000000000..8f9ca3bbe
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.tcf.te.core.cdt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.settings/org.eclipse.jdt.core.prefs b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..2bdb33c93
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Feb 06 07:11:39 CET 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..584fc9ad0
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.tcf.te.core.cdt;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.tcf.te.core.cdt.activator.CoreBundleActivator
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.eclipse.cdt.core;bundle-version="5.3.1";visibility:=reexport,
+ org.eclipse.tcf.te.runtime;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Export-Package: org.eclipse.tcf.te.core.cdt.activator;x-internal:=true,
+ org.eclipse.tcf.te.core.cdt.elf,
+ org.eclipse.tcf.te.core.cdt.nls;x-internal:=true
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/build.properties b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/build.properties
new file mode 100644
index 000000000..f4ae97015
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/plugin.properties
new file mode 100644
index 000000000..628019a1e
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/plugin.properties
@@ -0,0 +1,12 @@
+##################################################################################
+# Copyright (c) 2012 Wind River Systems, Inc. and others. 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:
+# Wind River Systems - initial API and implementation
+##################################################################################
+
+pluginName = Target Explorer, Core CDT Extensions
+providerName = Eclipse.org - TCF
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/pom.xml b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/pom.xml
new file mode 100644
index 000000000..a15454df8
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/pom.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.tcf</groupId>
+ <artifactId>tcf-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <version>1.0.0.qualifier</version>
+ <artifactId>org.eclipse.tcf.te.core.cdt</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/activator/CoreBundleActivator.java b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/activator/CoreBundleActivator.java
new file mode 100644
index 000000000..0cadf6a8f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/activator/CoreBundleActivator.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Wind River Systems, Inc. and others. 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.core.cdt.activator;
+
+import org.eclipse.tcf.te.runtime.tracing.TraceHandler;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class CoreBundleActivator implements BundleActivator {
+ // The bundle context
+ private static BundleContext context;
+ // The trace handler instance
+ private static TraceHandler traceHandler;
+
+ /**
+ * Returns the bundle context
+ *
+ * @return the bundle context
+ */
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getContext() != null && getContext().getBundle() != null) {
+ return getContext().getBundle().getSymbolicName();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the bundles trace handler.
+ *
+ * @return The bundles trace handler.
+ */
+ public static TraceHandler getTraceHandler() {
+ if (traceHandler == null) {
+ traceHandler = new TraceHandler(getUniqueIdentifier());
+ }
+ return traceHandler;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext bundleContext) throws Exception {
+ CoreBundleActivator.context = bundleContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext bundleContext) throws Exception {
+ CoreBundleActivator.context = null;
+ traceHandler = null;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/elf/ElfUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/elf/ElfUtils.java
new file mode 100644
index 000000000..55c660900
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/elf/ElfUtils.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Wind River Systems, Inc. and others. 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.core.cdt.elf;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.cdt.utils.elf.Elf;
+import org.eclipse.cdt.utils.elf.Elf.ELFhdr;
+
+/**
+ * Provides ELF file utilities.
+ */
+public final class ElfUtils {
+
+ /**
+ * Returns the ELF image type if the specified file is an ELF file at all.
+ *
+ * @param file The file representation of the physical file to test. Must be not <code>null</code>!
+ * @return The ELF image type as defined within <code>org.eclipse.cdt.utils.elf.Elf.Attribute</code>, or <code>-1</code> if invalid or not detectable.
+ */
+ public static int getELFType(File file) throws IOException {
+ int type = -1;
+
+ if (file != null) {
+ Elf elfFile = null;
+ try {
+ elfFile = new Elf(file.getAbsolutePath());
+ type = elfFile.getAttributes().getType();
+ }
+ finally {
+ if (elfFile != null) {
+ elfFile.dispose();
+ }
+ elfFile = null;
+ }
+ }
+ return type;
+ }
+
+ /**
+ * Returns the ELF address class if the specified file is an ELF file at all.
+ *
+ * @param file The file representation of the physical file to test. Must be not <code>null</code>!
+ * @return The ELF address class as defined within <code>org.eclipse.cdt.utils.elf.Elf.ELFhdr.ELFCLASS*</code>. <code>ELFCLASSNONE</code> (0) if the ELF address class is not set.
+ */
+ public static int getELFClass(File file) throws IOException {
+ int elfclass = Elf.ELFhdr.ELFCLASSNONE;
+
+ if (file != null) {
+ Elf elfFile = null;
+ try {
+ elfFile = new Elf(file.getAbsolutePath());
+ elfclass = elfFile.getELFhdr().e_ident[ELFhdr.EI_CLASS];
+ }
+ finally {
+ if (elfFile != null) {
+ elfFile.dispose();
+ }
+ elfFile = null;
+ }
+ }
+ return elfclass;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.java
new file mode 100644
index 000000000..df035fa9e
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Wind River Systems, Inc. and others. 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.core.cdt.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Core plugin externalized strings management.
+ */
+public class Messages extends NLS {
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.core.cdt.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.properties
new file mode 100644
index 000000000..2e9bb961f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.core.cdt/src/org/eclipse/tcf/te/core/cdt/nls/Messages.properties
@@ -0,0 +1,5 @@
+#
+# org.eclipse.tcf.te.core.cdt
+# Externalized Strings.
+#
+

Back to the top