The trick I use is to put a usleep call as the very first native line in my debug code.
This makes your thread sleep and gives the debugger a chance to be ready for you.
#include <unistd.h>
.
.
.
#ifndef NDEBUG
usleep(5000 * 1000);
#endif
More Related Contents:
- How to use JNI bitmap operations for helping to avoid OOM when using large images? [closed]
- Eclipse compiles successfully but still gives semantic errors
- What is the best way to save JNIEnv*
- How can I catch SIGSEGV (segmentation fault) and get a stack trace under JNI on Android?
- How to Debug Android application line by line using Eclipse?
- How to resolve “Waiting for Debugger” message?
- What’s wrong with debugging in Eclipse on Android? [duplicate]
- Android NDK build, Method could not be resolved
- Calling native method twice of third party library in an Activity causes the Android application to close down
- Debug native code in Android Library
- CLI on DalvikVM fails on JNI lib
- Write file to location other than SDcard using Android NDK?
- Set Build path in Eclipse for ndk program
- Rotating a bitmap using JNI & NDK
- NDK – How to use a generated .so library in another project
- Debugging Android NDK native apps
- Any simple way to log in Android NDK code?
- How to Find memory leaks from native code in android
- Why do some Android phones cause our app to throw an java.lang.UnsatisfiedLinkError?
- How to Use Eclipse to Debug JNI code (Java & C/C++)
- Android JNI – Call AttachCurrentThread without DetachCurrentThread
- Eclipse Juno ADT plugin NDK path removed?
- How to view SQL database in Eclipse Debug mode for android
- Javah Error android.app.Activity not found
- WARNING: ABIs [armeabi-v7a,armeabi] set by ‘android.injected.build.abi’ gradle flag contained ‘ARMEABI’ not targeted by this project
- Adding a library/JAR to an Eclipse Android project
- Android Unknown Command ‘crunch’
- ADT blank activity created with fragment activity
- Power-Off or Restart an android device via Code/Program?
- How to take emulator screenshots using Eclipse?