How do I debug my own native Android lib in eclipse with ARM DS-5 without crazy?

I call Ninjas Android NDK debugging here!

I have tried so many tutorials on debugging native Android code, so I can't remember them. Now I'm trying to get an ARM DS-5 . I worked with Android NDK samples, where the main activity loads the library. Laggy, but it works.

But my project is a bit more complicated. My main activity has a button, when I click it, SubActivity launches and loads its own lib. When I just try to use the DS-5 debugger when the main activity loads, I assume that the debugger is trying to connect to lib, but does not work, saying:

Execution stopped at: 0xAFD0C52C Connected to unknown platform 0xAFD0C52C POP {r4,r7} file "D:\workspace\Project\bin\app_process" WARNING(IMG53): app_process has no line debug information add-symbol-file "D:\workspace\Project\bin\libc.so" Loading library symbols: libc.so WARNING(IMG53): libc.so has no line debug information Execution stopped at: 0xAFD0C748 In thread 2 (OS thread id 7606) In __futex_syscall3 (no debug info) add-symbol-file "D:\workspace\Project\obj\local\armeabi\libName.so" Execution stopped at: 0xAFD0C748 In thread 3 (OS thread id 7607) Execution stopped at: 0xAFD0BFFC In thread 4 (OS thread id 7608) In __rt_sigtimedwait (no debug info) Execution stopped at: 0xAFD0B854 In thread 5 (OS thread id 7609) In select (no debug info) Execution stopped at: 0xAFD0C748 In thread 6 (OS thread id 7610) In __futex_syscall3 (no debug info) Execution stopped at: 0xAFD0B70C In thread 7 (OS thread id 7611) In __ioctl (no debug info) Execution stopped at: 0xAFD0B70C In thread 8 (OS thread id 7612) Execution stopped at: 0xAFD0C52C In thread 1 (OS thread id 7605) In epoll_wait (no debug info) 0xAFD0C52C POP {r4,r7} WARNING(CMD454): The shared library D:\workspace\Project\obj\local\armeabi\libName.so is currently not loaded by the application so the request has been pended cd "D:\workspace" Working directory "D:\workspace" directory "D:\workspace\Project" Source directories searched: D:\workspace\Project;$cdir;$cwd;$idir break -d -p "D:\workspace\Project\jni\Name.cpp":525 WARNING(CMD452-COR167): ! Breakpoint 1 has been pended ! No compilation unit matching "D:/workspace/Project/jni/Name.cpp" was found condition 1 break-script 1 "" ignore 1 0 break-stop-on-threads 1 unsilence 1 Breakpoint 1 unsilenced 

I think he is trying to connect to his native lib when Main Activity starts. But the library is loading later!

What I tried:

  • Set a Java breakpoint in SubActivity after loading your own library, then plug in the DS-5 debugger. But I get various errors from Eclipse talking about timeouts, whatever.
  • In the debug configuration settings, I can’t select the action that should trigger the debugging of my own code, there is combobox, but it is disabled:

The question itself is: if my library does not load the main Activity, how can I make DS-5 wait for the lib to load?

enter image description here

+6
source share
1 answer

Do you really need to have exact behavior between the debug and release versions? If not, load the library into the main action, also in the debug version.

0
source

Source: https://habr.com/ru/post/905998/


All Articles