Sysprogs forums › Forums › VisualGDB › Duplicate gdbservers
- This topic has 1 reply, 1 voice, and was last updated 10 years, 3 months ago by Nelno.
-
AuthorPosts
-
August 7, 2014 at 19:37 #802NelnoParticipant
First off — I just started with the 30-day trial yesterday and VisualGDB has impressed me. Native debugging is more responsive and more reliable in VS 2013 with VisualGDB than in Eclipse.
However, I’m having one issue that’s causing me some trouble. All of our native Android applications link to another native library of our own but when building a Debug version of the library, VisualGDB is always specifying NDK_DEBUG=1 when it launches ndk-build. This causes a problem because the application is also built with NDK_DEBUG=1. Both the library and the application end up with lib/armeabi-v7a/gdbserver files and apkbuilder fails due to duplicate files:
1> [apkbuilder] Found duplicate file for APK: lib/armeabi-v7a/gdbserver
1> [apkbuilder] Origin 1:libsarmeabi-v7agdbserver
1> [apkbuilder] Origin 2:libsarmeabi-v7agdbserver
1>
1> BUILD FAILED
1> O:devandroidadt-bundle-windows-x86_64-20140702sdktoolsantbuild.xml:962: The following error occurred while executing this line:
1> O:devandroidadt-bundle-windows-x86_64-20140702sdktoolsantbuild.xml:973: The following error occurred while executing this line:
1> O:devandroidadt-bundle-windows-x86_64-20140702sdktoolsantbuild.xml:312: com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APKWhen building from a shell or my own scripts I can get around this by simply deleting the gdbserver file in the library path, but VisualGDB always wants to pass NDK_DEBUG=1 for both projects if I am building with the “Debug” solution config, whether I have them setup with dependencies in VS or not (currently not, because the dependency was already specified manually in the .mk file prior to using VisualGDB, and because building with the library as a dependency causes gdbserver to be written, which I must delete before the application package is built or I get a build failure).
I have traced NDK_DEBUG through the NDK make files but I’m not sure exactly what the solution is. NDK_DEBUG overloads the xml “debuggable” flag, otherwise NDK will use the xml flag. In either case (NDK_DEBUG=1 or debuggable=true) the gdbserver file will be output. I suspect that it is correct to have NDK_DEBUG=1 set to build any code I want to step through (thought I am not yet sure if NDK uses this to pass -g to gcc to generate debug information), but this causes the package build to fail unless I explicitly delete gdbserver from one place or the other.
So a couple of questions:
– Are we doing something wrong, i.e. is this problem unique to our setup?
– Do I indeed need NDK_DEBUG=1 set for both the library and the application code if I want to reliably debug both?Thanks for any help. I’ve researched this quite a bit online but I have seen very few people with the problem (which makes me think I’m doing something wrong) and no definitive answers to the above questions.
August 7, 2014 at 22:25 #3099NelnoParticipantI think I found a solution to this issue, though perhaps not the correct one. In -Debug.vgdbsettings file I changed true to false. This prevents the gdbserver file from being output and avoids the duplicate file error with apkbuilder. Debugging in the library code seems to work fine at that point, though it’s acting a bit like optimizations are on (though behavior seems identical whether or not I’ve built the library with NDK_DEBUG=1).
-
AuthorPosts
- You must be logged in to reply to this topic.