aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NativeAbi.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NdkHelper.java39
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchDelegate.java14
3 files changed, 40 insertions, 21 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NativeAbi.java b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NativeAbi.java
index 4bf1ff1..22d91ae 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NativeAbi.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NativeAbi.java
@@ -16,9 +16,13 @@
package com.android.ide.eclipse.ndk.internal;
+import com.android.sdklib.SdkConstants;
+
public enum NativeAbi {
- armeabi("armeabi"),
- x86("x86");
+ armeabi(SdkConstants.ABI_ARMEABI),
+ armeabi_v7a(SdkConstants.ABI_ARMEABI_V7A),
+ mips(SdkConstants.ABI_MIPS),
+ x86(SdkConstants.ABI_INTEL_ATOM);
private final String mAbi;
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NdkHelper.java b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NdkHelper.java
index cdde5ae..6fb2f80 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NdkHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/NdkHelper.java
@@ -28,30 +28,32 @@ import org.eclipse.core.runtime.Path;
import java.io.ByteArrayOutputStream;
import java.io.File;
-import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
-import java.util.List;
+import java.util.EnumSet;
+import java.util.Set;
@SuppressWarnings("restriction")
public class NdkHelper {
- private static final String MAKE = "make";
- private static final String CORE_MAKEFILE_PATH = "/build/core/build-local.mk";
+ private static final String MAKE = "make"; //$NON-NLS-1$
+ private static final String CORE_MAKEFILE_PATH = "/build/core/build-local.mk"; //$NON-NLS-1$
/**
* Obtain the ABI's the application is compatible with.
* The ABI's are obtained by reading the result of the following command:
* make --no-print-dir -f ${NdkRoot}/build/core/build-local.mk -C <project-root> DUMP_APP_ABI
*/
- public static List<NativeAbi> getApplicationAbis(IProject project, IProgressMonitor monitor) {
+ public static Collection<NativeAbi> getApplicationAbis(IProject project,
+ IProgressMonitor monitor) {
ICommandLauncher launcher = new CommandLauncher();
launcher.setProject(project);
String[] args = new String[] {
- "--no-print-dir",
- "-f",
+ "--no-print-dir", //$NON-NLS-1$
+ "-f", //$NON-NLS-1$
NdkManager.getNdkLocation() + CORE_MAKEFILE_PATH,
- "-C",
+ "-C", //$NON-NLS-1$
project.getLocation().toOSString(),
- "DUMP_APP_ABI",
+ "DUMP_APP_ABI", //$NON-NLS-1$
};
try {
launcher.execute(getPathToMake(), args, null, project.getLocation(), monitor);
@@ -65,13 +67,16 @@ public class NdkHelper {
launcher.waitAndRead(stdout, stderr, monitor);
String abis = stdout.toString().trim();
- List<NativeAbi> nativeAbis = new ArrayList<NativeAbi>(3);
+ Set<NativeAbi> nativeAbis = EnumSet.noneOf(NativeAbi.class);
+ for (String abi: abis.split(" ")) { //$NON-NLS-1$
+ if (abi.equals("all")) { //$NON-NLS-1$
+ return EnumSet.allOf(NativeAbi.class);
+ }
- for (String abi: abis.split(" ")) {
try {
nativeAbis.add(NativeAbi.valueOf(abi));
} catch (IllegalArgumentException e) {
-
+ AdtPlugin.printErrorToConsole(project, "Unknown Application ABI: ", abi);
}
}
@@ -90,12 +95,12 @@ public class NdkHelper {
ICommandLauncher launcher = new CommandLauncher();
launcher.setProject(project);
String[] args = new String[] {
- "--no-print-dir",
- "-f",
+ "--no-print-dir", //$NON-NLS-1$
+ "-f", //$NON-NLS-1$
NdkManager.getNdkLocation() + CORE_MAKEFILE_PATH,
- "-C",
+ "-C", //$NON-NLS-1$
project.getLocation().toOSString(),
- "DUMP_TOOLCHAIN_PREFIX",
+ "DUMP_TOOLCHAIN_PREFIX", //$NON-NLS-1$
};
try {
launcher.execute(getPathToMake(), args, null, project.getLocation(), monitor);
@@ -120,7 +125,7 @@ public class NdkHelper {
*/
private static synchronized IPath getUtilitiesFolder() {
IPath ndkRoot = new Path(NdkManager.getNdkLocation());
- IPath prebuilt = ndkRoot.append("prebuilt"); //$NON-NLS-1$
+ IPath prebuilt = ndkRoot.append("prebuilt"); //$NON-NLS-1$
if (!prebuilt.toFile().exists() || !prebuilt.toFile().canRead()) {
return ndkRoot;
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchDelegate.java b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchDelegate.java
index 7070c08..36af976 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ndk/src/com/android/ide/eclipse/ndk/internal/launch/NdkGdbLaunchDelegate.java
@@ -39,6 +39,7 @@ import com.android.sdklib.AndroidVersion;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.xml.ManifestData;
import com.android.sdklib.xml.ManifestData.Activity;
+import com.google.common.base.Joiner;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.CDebugUtils;
@@ -62,6 +63,7 @@ import org.eclipse.jface.dialogs.Dialog;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@@ -69,6 +71,8 @@ import java.util.concurrent.TimeUnit;
@SuppressWarnings("restriction")
public class NdkGdbLaunchDelegate extends GdbLaunchDelegate {
+ private static final Joiner JOINER = Joiner.on(", ").skipNulls();
+
private static final String DEBUG_SOCKET = "debugsock"; //$NON-NLS-1$
@Override
@@ -120,7 +124,7 @@ public class NdkGdbLaunchDelegate extends GdbLaunchDelegate {
// Get ABI's supported by the application
monitor.setTaskName(Messages.NdkGdbLaunchDelegate_Action_ObtainAppAbis);
- List<NativeAbi> appAbis = NdkHelper.getApplicationAbis(project, monitor);
+ Collection<NativeAbi> appAbis = NdkHelper.getApplicationAbis(project, monitor);
if (appAbis.size() == 0) {
AdtPlugin.printErrorToConsole(project,
Messages.NdkGdbLaunchDelegate_LaunchError_UnableToDetectAppAbi);
@@ -175,6 +179,12 @@ public class NdkGdbLaunchDelegate extends GdbLaunchDelegate {
if (compatAbi == null) {
AdtPlugin.printErrorToConsole(project,
Messages.NdkGdbLaunchDelegate_LaunchError_NoCompatibleAbi);
+ AdtPlugin.printErrorToConsole(project,
+ String.format("ABI's supported by the application: %s", JOINER.join(appAbis)));
+ AdtPlugin.printErrorToConsole(project,
+ String.format("ABI's supported by the device: %s, %s", //$NON-NLS-1$
+ deviceAbi1,
+ deviceAbi2));
return false;
}
@@ -415,7 +425,7 @@ public class NdkGdbLaunchDelegate extends GdbLaunchDelegate {
}
private NativeAbi getCompatibleAbi(String deviceAbi1, String deviceAbi2,
- List<NativeAbi> appAbis) {
+ Collection<NativeAbi> appAbis) {
for (NativeAbi abi: appAbis) {
if (abi.toString().equals(deviceAbi1) || abi.toString().equals(deviceAbi2)) {
return abi;