0

I am using Eclipse and trying to step through the native portions of the NDK OpenCV 2.4.8 samples, e.g. "T2 - Mixed Processing". I can both Run as Android App and Debug as Android App, and in the latter case I hit breakpoints in the Java parts (e.g. Tutorial2Activity.java) but not in the C++ parts (e.g. jni_part.cpp). I tried "Debug as Android Native Application" but nothing happened and I saw no new messages in LogCat.

What do I need to do to be able to hit the C++ breakpoints?

Thank you

IZ73
  • 33
  • 6
  • by the way.. I develop for same environment.. can you check that 2.4.8 native camera (NativeActivity) runs on your phone? I suspect heavy memory corruption bug on this 31-december release because none of mine work.. – kagali-san Jan 18 '14 at 23:52
  • From a quick check, it seems that a delay should be made before JNI calls.. http://stackoverflow.com/questions/17705109/how-to-debug-c-c-code-ndk-in-eclipse – kagali-san Jan 18 '14 at 23:54
  • Make sure you upgrade the OpenCV Manager after it gets installed on your device. I think you need 2.16 but what gets installed when you first debug your app is an older version. Upgrade it. This is what worked for me. I test on Samsung Galaxy S4 and all samples work fine. – IZ73 Jan 19 '14 at 00:10
  • thanks for that. First Galaxy S and a MTK6589 phone aren't working for me with Native activity sample, all Java samples work though. So, did delaying the calls worked? – kagali-san Jan 19 '14 at 00:25
  • I didn't try because I don't think it'll help. The app only goes into the C++ part of the app when a button is pressed. The app does not even start when I debug as native. I added `NDK_DEBUG=1` to the C++ build command but that did not help. So I am still looking... – IZ73 Jan 19 '14 at 03:26

1 Answers1

2

According to comment #5 to this post, there is a bug in run-as in 4.3 which is the version of Android I am using. Hopefully it will be fixed but for now I need to find some other approach to debug my code.

Community
  • 1
  • 1
IZ73
  • 33
  • 6