Zu Zhu
Zu Zhu

Reputation: 11

How to debug native android runtime(ART) module fast through gdb/lldb etc.?

I run android system on my linux with emulator, and now I want to debug android runtime(ART).
I can debug through the following methods now:

  1. first replace the system's libart with debug_info library.
emulator
adb root
adb remount
adb push ~/android/library/libart.so /system/lib/libart.so
  1. Then perform port forwarding within the Android system, and use gdbserver to listen within the Android system, using calendar applications as an example:
adb forward tcp:2345 tcp:2345
adb shell gdbserver 10.0.2.2:2345 am start -n com.android.calendar/com.android.calendar.LaunchActivity
  1. Use gdb to connect to gdbserver in host system and debug libart:
target remote :2345
dir ~/android/aosp/
b JNI_CreateJavaVM
r

But debugging ART in this way is very inconvenient. Is there a better debug method available?

Upvotes: 1

Views: 164

Answers (0)

Related Questions