How can I debug my own Android C library compiled externally with cmake

Essentially, I need to debug my own C code included in the FreeRDP Android project.

I successfully compiled a project downloaded from Github using the specified bash script. https://github.com/FreeRDP/FreeRDP/blob/master/docs/README.android

I also compiled the Android part correctly with Android Studio. I can run the Android application correctly and without problems on multiple devices by connecting to multiple Windows servers.

Changing the source of C in the native library creates a runtime error, so I need to debug the source code of C.

I have precisely his problem , to which no one could give an answer, and I do not even know if he found a solution. Unfortunately, my reputation (<50) does not allow me to post comments under this post (and other analogies)


I think the .so files compiled correctly, I checked with objdump --syms and objdump --debugging , but I cannot enter my own code. In Android Studio, I installed Debug type: Dual , and I also tried putting LLDB Startup Commands something like breakpoint set --name <function> with no effects.

When native code throws an exception

--------- start of the crash
10-02 14: 42: 22.064 32032-32032 / com.freerdp.afreerdp A / libc: fatal signal 11 (SIGSEGV), code 1, error addr 0x28 in tid 32032 (reerdp.afreerdp)

Debugging stopped with the following error:

__ lldb_unnamed_symbol64 $$ libfreerdp-android2.so

(I can not post a screenshot of Android Studio because of my reputation)


Of course, there is no problem creating an application that uses native code and sets the bracket point inside native code. https://developer.android.com/ndk/guides/index.html


Environment:
Ubuntu 16.04.3 LTS
Android Studio 2.3.3
Gradle version 3.3
cmake version 3.5.1 (on system)
cmake version 3.6.0-rc2 (on android sdk)
lldb version 4.0.0 (on android sdk)

Thanks in advance to anyone who can help me.

Andrea

+3
source share

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


All Articles