Begin extracting symbol discovery logic.

This is a weird responsibility for a class called "FrameInfo", and the
organization makes it difficult to add new discovery methods in a way I
can feel confident about. It's also hard to test. This is the first step
in pulling all of `FrameInfo.get_elf_file()` out into a new
`SymbolSource` class, which will have subclasses for each source type.
When I'm done refactoring that'll be the ELF file source, which is the
one I've done here since it's the base for all the other types; an APK
source; and a directory source. Once the refactor is done, I'll add the
new source type for the Play debug symbols zip.

`GetElfFileTests` is going to stick around and be ugly, as will the
`FrameInfo.get_elf_file()` implementation for the time being because
it's even harder to keep the tests running if I rewrite that function in
pieces. Once the refactor is done the tests will be much simpler and
(hopefully) without mocks.

Bug: https://github.com/android/ndk/issues/2078
Test: ./checkbuild.py pytest
Change-Id: Ie7b6cf47b9a5060005808168d16ac9d359d6998e
2 files changed
tree: b6332c4adeb7a5b8ddbd97a8998edbead3224e73
  1. .github/
  2. build/
  3. docs/
  4. infra/
  5. meta/
  6. ndk/
  7. samples/
  8. scripts/
  9. sources/
  10. tests/
  11. wrap.sh/
  12. .clang-format
  13. .gitignore
  14. Android.mk
  15. checkbuild.py
  16. CleanSpec.mk
  17. CONTRIBUTING.md
  18. MANIFEST.in
  19. navbar.md
  20. ndk-gdb
  21. ndk-gdb.cmd
  22. ndk-stack
  23. ndk-stack.cmd
  24. ndk-which
  25. ndkgdb.py
  26. ndkstack.py
  27. NOTICE
  28. OWNERS
  29. parse_elfnote.py
  30. poetry.lock
  31. pyproject.toml
  32. qa_config.json
  33. README.md
  34. run_tests.py
  35. setup.py
  36. unittest.cfg
  37. UserReadme.md
README.md

Android Native Development Kit (NDK)

The latest version of this document is available at https://android.googlesource.com/platform/ndk/+/main/README.md.

Note: This document is for developers of the NDK, not developers that use the NDK.

The NDK allows Android application developers to include native code in their Android application packages, compiled as JNI shared libraries.

To navigate this site, use the navigation bar at the top of the page. For additional documentation, see the listing for the docs directory. If you're not sure where to start, the Onboarding page will guide you.

Other Resources