![]() If there no debug symbols available, you might have to build the referenced library in debug mode. So in order to debug those you should copy them from outside the android-build directory where each *.so is generated. If the libraries are built using the Qt for Android toolchain, the *.sos deployed to $SHADOW_BUILD/android-build are also stripped(where $SHADOW_BUILD is the build directory usually starting with build-*). Deploying *.sos which are not stripped is allowing you to have debugging sessions and step inside the native libraries. The stripping solution works, but in my case, it needed a Clean & Build before hitting the breakpoints in the library. Is there a way to stop Android Studio from stripping the *.sos? I tried How to avoid stripping for native code symbols for android app but didn't have any effect, *.apk file is the same size as before and debugging the native libraries still doesn't work. libclorysdk.so built in debug mode has about 10MB while the libclorysdk.so file which I extracted after unarchiving the generated *.apk file is just 350KB.Īs stated here, running greadelf -debug-dump=decodedline libclorysdk.so on the debug version outputs references to the source files, but if the command is run on the *.apk extracted library, it outputs nothing. How is this possible to have no source-map defined(second lldb command) if the libclorysdk.so was built in Debug mode? Is it possible to explicitly set it so that the debugger would search there for the library's source files?Īfter searching more I found out that the process of creating the APK actually strips the *.so libraries from their debugging symbols. Android Studio: C:Program FilesAndroidAndroid Studiojre Gradle: C:Program FilesAdoptOpenJDKjdk-11.0.3. ![]() externalNativeBuild, range = [0xcb41e82c-0xcb41e970), name="Clory::Engine::instance(Clory::RuntimeConfiguration const&, Clory::Engine::Purpose)", mangled="_ZN4Clory2Engine8instanceERKNS_20RuntimeConfigurationENS0_7PurposeE"įirst of all, there was no CompileUnit section in the result of the command image lookup -vrn Clory::Engine::instance. Android Studio and Gradle are using different locations for the JDK. The adle file specifies the CMakeLists.txt file which configures the C++ layer. The debugger works, I can step inside the Java_clory_engine_sdk_CloryNative_nativeInit function, but I would also like to further debug the library corresponding to the Clory::Engine class which, as I mentioned, is an internal library we have source code access to.įor example, Clory::Engine::instance is part of the library and I would like to specify to Android Studio the location of the CloryEngine.cpp file so I can step inside Clory::Engine::instance with the debugger, thus debugging this static member function. Having access to the library source code, is it possible to specify to Android Studio the path to the source code so I can step inside the library using the debugger? ![]() The C++ library is a company internal library and we have access to its source code, but in the Android project it is only dynamically linked, so it is used only in the form of headers (. = Ģ)Android.mk Builds a shared library from C, c++ code and also links inbuilt shared and static libraries.I'm working on an Android project which uses a Java class that is a wrapper on a C++ library. Actual C files are not under jni folder but outside it but referred in android.mk file. Trying ndk-build C code debug in Android studio(v4.1.2).Below is adle setup. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |