5

Essentially I need to debug native C code included in the FreeRDP Android project.

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

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

A change to C source in the native library generates a runtime error, so I need to debug C source code.

I have exactly his problem to which no one has been able to give an answer and I do not even know if he has found a solution. Unfortunately my reputation (<50) does not allow me to post comments under that post (and other similars)


I think the .so files are compiled correctly, i have checked with objdump --syms and objdump --debugging but i can't step into native code. In Android Studio i have set Debug type: Dual and i also tried to put on LLDB Startup Commands something like breakpoint set --name <function> with no effects.

When the native code thrown the exception

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

The debug stopped with following error:

__ lldb_unnamed_symbol64$$libfreerdp-android2.so

(i can't post Android Studio screenshot due my reputation)


Of course there is no problem creating an application that uses native code and set brackpoint inside the 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 give me any help.

Andrea

AndreaT
  • 367
  • 2
  • 10
  • 1
    I guess now you can post the screenshots as well as the answer itself. – Pulathisi Bandara Dec 17 '17 at 15:59
  • Unfortunately I'm still looking for the answer. – AndreaT Jan 03 '18 at 08:05
  • The answer for this one is already been published in the link you've provided which is `https://www.youtube.com/watch?v=8Cjeq4l5COU&feature=youtu.be`. Also the method behind the android studio is explained here, https://source.android.com/devices/tech/debug/gdb Android Studio 1.3+ supports native debugging so you need only the PID of the process, in the first part of the vdo he's obtaining the PID of the process. – Pulathisi Bandara Jan 26 '18 at 09:47
  • Please note that, GDB is not used in never versions of android studio, but the logic behind whatever debugger is the same. It needs the application that needs to be debugged and the options. – Pulathisi Bandara Jan 26 '18 at 09:55

0 Answers0