How to set NdkCompatAbi for Eclipse x86 Android JNI debugging?-Collection of common programming errors

I’m trying to debug a JNI crash on an Android x86 phone (San Diego). I’m using Eclipse/Helios and Linux, and I’m as up to date as Helios permits.

When I ‘Debug as… Native’ on an ARM phone, as is known, I have to mess around with

set solib-search-path ./obj/local/armeabi
file ./obj/local/armeabi/app_process

but things work as expected from that point, complete with the ‘no debugging symbols found’ lie.

On x86, before the ‘No segment defined’ and ‘Could not load shared library’ warnings to which the foregoing commands are a response appear, I get this pop-up instead:

Launching jniTestApp has encountered a problem:

Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:5039
Error message from debugger back end:
Remote 'g' packet reply is too long: fcffffff84fdf0bf10000000280000000...000

In the ‘ gdb traces’ console, I see this:

088,221 &"warning: while parsing target description (at line 1): Target description specified unknown architecture \"i386\"\n"

and looking in the ‘Android’ console, I see this:

[2012-11-08 11:06:23 - Substitute: ] ${NdkGdb}
[2012-11-08 11:06:23 - Substitute: ]  --> 
[2012-11-08 11:06:23 - Substitute: ] /home/tim/lib/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gdb
[2012-11-08 11:06:23 - Substitute: ] ${NdkProject}/obj/local/${NdkCompatAbi}/app_process
[2012-11-08 11:06:23 - Substitute: ]  --> 
[2012-11-08 11:06:23 - Substitute: ] /home/tim/gitsvn/workspace/jniTestApp/jniDir/builds/Android/obj/local/armeabi/app_process

and various other things referring to armeabi.

I observe I can change this in the debug configuration – setting Launch Options/Debugger/Debugger to /home/tim/lib/android-ndk-r8b/toolchains/x86-4.6/prebuilt/linux-x86/bin/i686-linux-android-gdb and replacing the Shared Library from ${NdkProject}/obj/local/${NdkCompatAbi} with the absolute …/obj/local/x86 path gets me back to where I ensure the library is loaded, then suspend and paste into gdb

set solib-search-path ./obj/local/x86
file ./obj/local/x86/app_process

which is great, but really it’s a bit of a faff. And error-prone.

A websearch for NdkCompatAbi just gives me java source files containing it, and searching for NdkGdb isn’t helpful.

Are these variables set anywhere I can get to them?

My issue has resolved; I don’t know whether this is an interesting question now.

It seems that this problem arose because when I tried to Debug as… Native, the Navigator panel elected not to give me a properly populated submenu – only offering ‘debug configurations’ which I clicked on and used to create a debug configuration ‘manually’. Somehow, that managed to set up the non-adaptive behaviour outlined above. Perhaps I tried to ‘debug’ from the src/ folder instead of the project? I don’t know.