Preface: I am not producing an Android app. I work for a software component business, creating shared libraries, compiled from C and C++ code, for use in third-party customers' apps. I test my libraries in a command-line test harness, which I run in the ADB shell. I am only producing software for 64-bit ARM, because none of the customers want 32-bit code.I gather lldb is now the debugger in Android Studio.
However, I don't use Android Studio, and don't even install it. I find it far easier to do Android NDK work with editor and command line. I'm partially sighted, which is among the reasons for this.Looking at NDK23b on Linux, I see executables for both gdb and lldb and device-side servers for both. Could someone point me to documentation for getting lldb-server and lldb operating on an Android device connected by USB to my Linux development machine?
--Thanks,John
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgn8vfPbi16gdphXbJqL%3D4KSmpY9n3su9iF8z_w0vg%2B8VA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZop_yuQCwJS2VS8xMQoUtKv_1shUwQo5QFFN0bdzbAS77Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZop_yuQCwJS2VS8xMQoUtKv_1shUwQo5QFFN0bdzbAS77Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgkDM3Qj7BOXz3TMVOEk3%3Dys03%2BvQJn-awCLg%3Dgsd-jTvQ%40mail.gmail.com.
ndk-build
script. The ndk-gdb
script does not support using the legacy make APP=<name>
method to build.AndroidManifest.xml
file by including an <application>
element that sets the android:debuggable
attribute to true
.AndroidManifest.xml
file does not matter.ndk-gdb-py
Python implementation.To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZoo6J9ANK21oiDUNSAcuswH-bimx75BEXNMN3-YF0wb1VA%40mail.gmail.com.
> i'd suggest you either use the ndk-gdb script to hide the details, or read it/run it once to> see what the proper setup looks like and then adapt that to your environment.I can't follow several of the instructions in https://developer.android.com/ndk/guides/ndk-gdb:For command-line native debugging to work, these requirements must be met:
- Build your app using the
ndk-build
script. Thendk-gdb
script does not support using the legacymake APP=<name>
method to build.I'm not using ndk-build. I have never used any of the Android Studio or NDK build systems, and have no idea how.
- Enable app debugging in your
AndroidManifest.xml
file by including an<application>
element that sets theandroid:debuggable
attribute totrue
.I'm not building an app, and have no manifest.
- Use GNU Make 3.81 or higher.
I don't use any kind of make program. The software I work on doesn't use them at all.
- Build your app to run on Android 2.2 (Android API level 8) or higher.
- Debug on a device or emulator running Android 2.2 or higher. For debugging purposes, the target API level that you declare in your
AndroidManifest.xml
file does not matter.- Develop your app in a Unix shell. On Windows, use Cygwin or the experimental
ndk-gdb-py
Python implementation.Those are no problem: I'm building on Linux with API 28, and running on Android 9.0.If there's a way to get lldb to output the commands it runs, I could try to set up a conventional minimal app to get something for it to work on.
I have never done this, because it simply isn't what my job needs, and it will be very hard for me if it involves GUI tools. I may have to settle for carrying on using GDB, as opposed to going through the basics of learning Android app programming, which is likely to take me a couple of weeks.Is there really no documentation for this?
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgmw7Q2gRrCAUfjsmBM_8EgbwJz7A8gq8d6dsFSA1-ViiA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZoo4XwX1%2B%3Dy%2B%3DK3xpnSCEpe9Vxw0x3NPNv0Zhhc5YEbrDA%40mail.gmail.com.
`ndk-gdb --help` does list some options that might help you attach to a non-app project. It's not something I've ever done that I can recall, but if none of those suit your needs, file a bug at https://github.com/android/ndk/issues? I can't promise that we'll be able to tackle it soon given the other tasks we have to balance, but aside from our available bandwidth I can't see any argument against supporting that kind of workflow. I imagine that does cover most middleware development workflows, since AGP support for native middleware distribution is still quite new (and is lacking some pretty important features still).gdbclient is part of the platform, and afaik is only useful for debugging platform components: https://cs.android.com/android/platform/superproject/+/master:development/scripts/gdbclient.py.
Between that and ndk-gdb you can probably work out the correct incantation for connecting LLDB to whatever you're working on (I've never worked on ndk-gdb and I don't think I've touched gdbclient for close to a decade, so you probably already know better than I do).Another option (and this is the one I'd probably be trying myself, FWIW), is to set up an AGP project that can build your components as an AAR, add the tests as another gradle module, and then use Android Studio to debug the tests. I haven't actually tried debugging native tests in Android Studio before, but I don't think Studio even knows the difference between test code and app code, so it probably Just Works? If not, those are bugs worth chasing IMO.If you want to try something that definitely isn't finished, but might be ready enough for some use cases, https://github.com/rr-debugger/rr is growing Android support atm and has some very cool features (replay/rewind).
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAFVaGhvfUAGS-PxEWvuB5HaRF8fAAnfHVmpvspFVnLzhjKQSFg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAJgzZopRjH3%3DPpwufJsLyH6jYrMmP1vRjNK7CrQj5b97P5F6VA%40mail.gmail.com.