Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid NDK debugging in Eclipse - how to stop segfaults/SIGILL that only occur when stepping in native code
    text
    copied!<p>I have set up debugging in Eclipse for native code using the Android NDK (on Windows XP, with Cygwin) to the stage where I can set breakpoints in both Java and native code and the debugger will break at them correctly. My issue is that when stepping through the native code, I will often get segmentation faults/SIGILLs that do not occur when continuing past the breakpoint instead.</p> <ul> <li>My application is debuggable as defined in AndroidManifest.xml</li> <li>I have altered the (NDK)/build/core/build-binary.mk to prevent it from stripping out debug symbols when <code>APP_OPTIM</code> is defined as debug, which it is in the Application.mk file in my jni directory</li> <li>I have defined <code>LOCAL_CFLAGS := -g -O0</code> in the Android.mk file, and I have also tried each of these flags individually</li> </ul> <p>I have read that this problem is to do with the optimised code generated, but turning optimisation off with <code>-O0</code> has no impact on my issue. I have also come across using the <code>NDK_BUILD=1</code> flag when building, but defining <code>debuggable=true</code> in AndroidManifest.xml apparently has the same effect.</p> <p>I have tried this both on an emulator (running 2.3.3) and on a device (running 2.2 - which surprisingly didn't have the thread issues I expected), with similar results (although if I remember correctly, the failures happened at different points in code).</p> <p>Does anyone have any insight into possible fixes/steps I could try, and/or have been able to successfully step through native code with no issues?</p> <p>Thanks very much <hr> <strong>Edit:</strong> This was never really solved, but for anyone who wants to take a look at my guide for NDK debugging, you can find it <a href="http://esotericgamer.co.uk/pro/android-ndk.html" rel="nofollow noreferrer">here</a>.</p> <p><strong>Edit 2:</strong> The answers I got to this question came once new versions of the NDK had come out, and this question may now be redundant. My guide may still work, but I haven't been using the NDK for a while so I cannot vouch for its continued correctness. I have accepted the answer I have as all three basically say the same thing, and that was the first one to be submitted.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload