Debugging Android NDK C/C++ code in Eclipse – breakpoints are not hit

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

Leave a Comment