[all-commits] [llvm/llvm-project] 12dee9: [lldb][Android] Support zip .so file

Kazuki Sakamoto via All-commits all-commits at lists.llvm.org
Tue Jun 20 15:41:46 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 12dee9d3cd762d9754e2adadffa13c1cce85cf07
      https://github.com/llvm/llvm-project/commit/12dee9d3cd762d9754e2adadffa13c1cce85cf07
  Author: Kazuki Sakamoto <sakamoto at splhack.org>
  Date:   2023-06-20 (Tue, 20 Jun 2023)

  Changed paths:
    A lldb/include/lldb/Host/common/ZipFileResolver.h
    A lldb/include/lldb/Utility/ZipFile.h
    M lldb/source/Host/CMakeLists.txt
    A lldb/source/Host/common/ZipFileResolver.cpp
    M lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    M lldb/source/Utility/CMakeLists.txt
    A lldb/source/Utility/ZipFile.cpp
    M lldb/unittests/Host/CMakeLists.txt
    A lldb/unittests/Host/common/CMakeLists.txt
    A lldb/unittests/Host/common/Inputs/zip-test.zip
    A lldb/unittests/Host/common/ZipFileResolverTest.cpp

  Log Message:
  -----------
  [lldb][Android] Support zip .so file

In Android API level 23 and above, dynamic loader is able to load .so file
directly from APK, which is zip file.
https://android.googlesource.com/platform/bionic/+/master/
android-changes-for-ndk-developers.md#
opening-shared-libraries-directly-from-an-apk

The .so file is page aligned and uncompressed, so
ObjectFileELF::GetModuleSpecifications works with .so file offset and size
directly from zip file without extracting it. (D152757)

GDBRemoteCommunicationServerCommon::GetModuleInfo returns a module spec to LLDB
with "zip_path!/so_path" file spec, which is passed through from Android
dynamic loader, and the .so file offset and size.

PlatformAndroid::DownloadModuleSlice uses 'shell dd' to download the .so file
slice from the zip file with the .so file offset and size.

Differential Revision: https://reviews.llvm.org/D152759




More information about the All-commits mailing list