title: android ndk gdb loaded sharedlibraries missing *.oat
body: <p>Both <code>gdb 7.7</code> and <code>gbd 7.11</code> missed some shared libraries when debugging my device (oppo r7s). <em>I've pulled all libraries to local</em>.<br />
  Here is a complete list of libraries shown by <code>info shared</code></p>
  <pre><code>(gdb) info shared
  From        To          Syms Read   Shared Object Library
  0x40000980  0x40009640  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\linker
  0x401c7940  0x401ce6e8  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libutils.so
                          No          libstdc++.so
                          No          libm.so
  0x4013bbb0  0x4017329c  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libc.so
                          No          libbinder.so
                          No          liblog.so
                          No          libhardware.so
                          No          libcutils.so
                          No          libc++.so
                          No          libLLVM.so
                          No          libbcinfo.so
                          No          libunwind.so
                          No          libz.so
                          No          libpng.so
                          No          libpowermanager.so
                          No          libcommon_time_client.so
                          No          libstlport.so
                          No          libui.so
                          No          libsync.so
                          No          libgui.so
                          No          libft2.so
                          No          libbcc.so
                          No          libGLESv2.so
                          No          libGLESv1_CM.so
                          No          libEGL.so
                          No          libunwind-ptrace.so
                          No          libgccdemangle.so
                          No          libcrypto.so
                          No          libicuuc.so
                          No          libicui18n.so
                          No          libjpeg.so
                          No          libexpat.so
                          No          libpcre.so
                          No          libharfbuzz_ng.so
                          No          libstagefright_foundation.so
                          No          libsonivox.so
                          No          libnbaio.so
                          No          libcamera_client.so
                          No          libaudioutils.so
                          No          libaudioparameter.so
                          No          libinput.so
                          No          libhardware_legacy.so
                          No          libcamera_metadata.so
                          No          libgabi++.so
                          No          libskia.so
                          No          libRScpp.so
                          No          libRS.so
                          No          libwpa_client.so
                          No          libnetutils.so
                          No          libspeexresampler.so
  0x402635b0  0x402724a4  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libandroidfw.so
                          No          libGLES_trace.so
                          No          libbacktrace.so
                          No          libusbhost.so
                          No          libssl.so
                          No          libsqlite.so
                          No          libsoundtrigger.so
                          No          libselinux.so
                          No          libprocessgroup.so
                          No          libpdfium.so
                          No          libnetd_client.so
                          No          libnativehelper.so
                          No          libnativebridge.so
                          No          libminikin.so
                          No          libmemtrack.so
                          No          libmedia.so
                          No          libinputflinger.so
                          No          libimg_utils.so
                          No          libhwui.so
                          No          libassert_tip_service.so
                          No          libETC1.so
  0x4006d230  0x400ca9dc  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libandroid_runtime.so
                          No          libNimsWrap.so
                          No          libsigchain.so
                          No          libvendorconn.so
                          No          libbacktrace_libc++.so
  0x41d4baa0  0x41f9ee24  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libart.so
                          No          libjavacore.so
                          No          memtrack.msm8916.so
                          No          libqti-perfd-client.so
                          No          libtinyxml.so
                          No          libqservice.so
                          No          libmm-abl-oem.so
                          No          libdiag.so
                          No          libmm-abl.so
                          No          libprotecteyes.so
                          No          libgsl.so
                          No          libadreno_utils.so
                          No          libEGL_adreno.so
                          No          libGLESv1_CM_adreno.so
                          No          libGLESv2_adreno.so
  0x68246388  0x68249184  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libandroid.so
                          No          libcompiler_rt.so
                          No          libjnigraphics.so
                          No          libvorbisidec.so
                          No          libstagefright_yuv.so
                          No          libstagefright_omx.so
                          No          libstagefright_enc_common.so
                          No          libstagefright_avc_common.so
                          No          libopus.so
                          No          libdrmframework.so
                          No          libstagefright_amrnb_common.so
                          No          libstagefright.so
                          No          libmtp.so
                          No          libjhead.so
                          No          libexif.so
                          No          libmedia_jni.so
                          No          libjavacrypto.so
                          No          libsoundpool.so
                          No          libaudioeffect_jni.so
                          No          librs_jni.so
                          No          libthwsplit.so
                          No          libwebviewchromium_loader.so
                          No          eglsubAndroid.so
                          No          libsc-a3xx.so
                          No          libqdutils.so
                          No          libqdMetaData.so
                          No          libmemalloc.so
                          No          gralloc.msm8916.so
                          No          libfmodex.so
                          No          libfmodevent.so
                          No          libstagefright_http_support.so
                          No          libeffects.so
                          No          libwilhelm.so
                          No          libOpenSLES.so
  0x7f9ceb40  0x8102f72c  Yes         Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libclient.so
                          No          libwebviewchromium.so
                          No          libwebviewchromium_plat_support.so
  (*): Shared library is missing debugging information.
  </code></pre>
  <p>But <code>oat</code> files are loaded when debugging other devices like Huawei (FRD-AL00).<br />
  Following is an excerpt of the output of <code>show shared</code> on such a device.</p>
  <pre><code>0x71867000  0x71cc76d6  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\system@framework@boot.oat
  0x721dc000  0x725657c4  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\system@framework@boot-core-libart.oat
  0x725dc000  0x7262d9cc  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\system@framework@boot-conscrypt.oat
  0x726c3000  0x727291ea  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\system@framework@boot-okhttp.oat
  0xea0de584  0xea0e5714  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libandroid.so
  0xe1b15da0  0xe1cdc3ec  Yes (*)     Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libart-compiler.so
                          No          /system/lib/libvixl.so
  0xc2b0ab40  0xc416b72c  Yes         Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libclient.so
                          No          /data/dalvik-cache/arm/system@app@WebViewGoogle@WebViewGoogle.apk@classes.dex
  </code></pre>
  <p>And without the libraries being loaded, gdb cannot unwind the stack correctly, the backtrace in oppo:</p>
  <pre><code>(gdb) bt
  #0  0x40168698 in __epoll_pwait () from Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libc.so
  #1  0x4013f746 in epoll_pwait () from Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libc.so
  #2  0x4013f754 in epoll_wait () from Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libc.so
  #3  0x401cdf56 in android::Looper::pollInner(int) () from Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libutils.so
  #4  0x401ce180 in android::Looper::pollOnce(int, int*, int*, void**) ()
     from Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libutils.so
  #5  0x4009c7dc in android::NativeMessageQueue::pollOnce(_JNIEnv*, int) ()
     from Z:\program\program\target\android_RelWithDebInfo\obj\local\armeabi-v7a\libandroid_runtime.so
  #6  0x72403cdc in ?? ()
  </code></pre>
  <p>The last address is in the <strong>system@framework@boot.oat</strong>, which will also work correctly when the <code>oat</code> file is loaded.</p>
  <p>Can anyone give some advice?</p>