I have an Android Native application that targets two different API
versions: 23 (Marshmallow) and 28 (Pie). For the API 28, I have no
problem debugging a hello world application when it enters the C++ code:
the debugger attaches itself and stops the execution at my breakpoints.
For the API 23 however, the debugger attaches itself but never stops at
the breakpoints. This behavior for both APIs is consistent across
emulators and real devices.
Expected behavior
I would expect the debugger to stop on breakpoints no matter the API used.
Actual behavior
For API 23 at least, the debugger ignores the breakpoints present in C++. The problem doesn't manifest itself when an emulator or real device uses a more recent API such as 28.
The only difference here is really the operating system. Everything else including memory allocation seems to be exactly the same.
CodeThe code is the same in both cases. It pretty much follows the default JNI template provided by Android. I'll post everything in any case.
C++ file called through JNI (this is where the breakpoints don't work!)
Reference to a repo demonstrating the problem
https://github.com/BenjaminTanguay/android-studio-breakpoint-failure
I have confirmed with a work colleague that the problem can be repeated on his environment. However, I don't know yet if the problem is environment specific (maybe it works with different versions of software), configuration specific (perhaps I made a mistake somewhere) or is a real bug in the Android tools.
If anyone can help, I would be very grateful.
Note: This post is somewhat of a copy of the stackoverflow question found here:
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/62771b58-bef7-43d7-9722-74170d1ea9fcn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/265777d5-9acf-49b4-b1f5-a3a92a8221f4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAP5h4q-q1q_TOSNjRf2P1_zPCgZ0g0wLL1KRXwqKZ5kobJ2sDQ%40mail.gmail.com.