This is an archive of the discontinued LLVM Phabricator instance.

[lldb_test_suite] Fix lldb test suite targeting remote Android
ClosedPublic

Authored by kusmour on Jul 2 2019, 8:07 PM.

Details

Summary

Fixed Android.rules for running test suite on remote android

  • the build configuration is not compatible with ndk structure, change it to link to static libc++
  • generally clang should be able to use libc++ and will link against the right library, but some libc++ installations require the user manually link libc++abi.
  • add flag -lc++abi to fix the test binary build failure

Added skipIfTargetAndroid skipUnlessTargetAndroid for better test support

  • the skipIfPlatform method will ask lldbplatformutil.getPlatform() for platform info which is actually the os type, and Android is not os type but environment
  • create this function to handle the android target condition

To Run Test on Remote Android
1 start lldb-server on your devices
2 run lldb-dotest with following configuration:
./lldb-dotest --out-of-tree-debugserver --arch aarch64 --platform-name remote-android --platform-url connect://localhost:12345 --platform-working-dir /data/local/tmp/ --compiler your/ndk/clang

Diff Detail

Repository
rL LLVM

Event Timeline

kusmour created this revision.Jul 2 2019, 8:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2019, 8:07 PM
kusmour edited the summary of this revision. (Show Details)Jul 2 2019, 8:12 PM
kusmour edited the summary of this revision. (Show Details)Jul 2 2019, 8:25 PM
xiaobai added a subscriber: labath.

This patch looks fine to me overall. I'm unsure if LLDB has a guarantee about which NDK version its compatible with, but I'm alright with staying up to date with the latest release

@labath: Maybe you'd be interested in this patch as well? I'm not sure who actually still works on android debugging at Google.

@kusmour: This patch doesn't have enough context with each change. Try getting the change with git diff -U9999 or something like that for the entire context.

srhines added inline comments.Jul 3 2019, 10:41 AM
lldb/packages/Python/lldbsuite/test/make/Android.rules
93 ↗(On Diff #207701)

This line could just be -lc++_static now for more simplicity (much like the next line).

labath accepted this revision.Jul 4 2019, 10:54 PM

This patch looks fine to me overall. I'm unsure if LLDB has a guarantee about which NDK version its compatible with, but I'm alright with staying up to date with the latest release

Yeah, that been my general objective while I was still working on android...

@labath: Maybe you'd be interested in this patch as well? I'm not sure who actually still works on android debugging at Google.

The patch looks fine to me. I am also not sure who still works on android debugging at Google :(, but I am glad that at least you guys are. :)

This revision is now accepted and ready to land.Jul 4 2019, 10:54 PM
kusmour updated this revision to Diff 208465.Jul 8 2019, 11:29 AM
kusmour edited the summary of this revision. (Show Details)

added method skipIfTargetAndroid

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2019, 2:39 PM