From 5d1753f7f5e13c8c4206be66b567a09a9ae0d648 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Wed, 14 Dec 2016 14:42:44 -0800 Subject: [PATCH] Document bionic loader logging properties Bug: http://b/29458203 Test: spellchecker in vim Change-Id: I81e60a09fa256110d7ab9b530e7821ae66e8f020 --- android-changes-for-ndk-developers.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md index 5b0fe38d4..ec4887098 100644 --- a/android-changes-for-ndk-developers.md +++ b/android-changes-for-ndk-developers.md @@ -321,3 +321,22 @@ dlopen failed: "/data/data/com.example.bad/lib.so" has unsupported e_shentsize: *Resolution*: don't use tools that produce invalid/malformed ELF files. Note that using them puts application under high risk of being incompatible with future versions of Android. + +## Enable logging of dlopen/dlsym and library loading errors for apps (Available in Android O) + +Starting with Android O it is possible to enable logging of all dlsym/dlopen calls +for debuggable apps. Here is short instruction on how to do that: +``` +adb shell setprop debug.ld.app.com.example.myapp dlsym,dlopen,dlerror +adb logcat +``` + +Any subset of (dlsym,dlopen,dlerror) can be used. + +On userdebug and eng builds it is possible to enable tracing for the whole system +by using debug.ld.all system property instead of app-specific one: +``` +adb shell setprop debug.ld.all dlerror,dlopen +``` + +enables logging of all errors and dlopen calls -- 2.11.0