[Lldb-commits] [PATCH] D152759: [lldb][Android] Support zip .so file

Kazuki Sakamoto via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 15 14:18:47 PDT 2023


splhack added inline comments.


================
Comment at: lldb/include/lldb/Host/common/ZipFileResolver.h:30
+
+  static bool ResolveBionicPath(const FileSpec &file_spec, FileKind &file_kind,
+                                std::string &file_path,
----------------
mib wrote:
> mib wrote:
> > This function name sounds like the the bionic linker is in the zip file which is not the case IIUC. I'm fine with adding a zip file resolver in lldb but I'd prefer if it had a generic name, otherwise, this should be a plugin.
> what about this instead ?
Yes, should be good. will update this diff.

(Why it had "Bionic" because I thought the path encoding "zip_path!/lib_path" is bionic specific.)


================
Comment at: lldb/source/Utility/ZipFile.cpp:19-21
+// Zip headers.
+// https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
+
----------------
mib wrote:
> Did you just copy & past the this file from somewhere else of did you implement it yourself ?
I implemented this code.

logic
- Linear search the end of central directory record from the file end because it is located at the end of the file with comment (64KB max)
- Linear search the file from the central directory records that is pointed by the end of central directory record.
- Get the file offset and size from the local file header that is pointed by the central directory record
- Use unaligned_uint16_t/unaligned_uint32_t since Zip header is 1 byte aligned. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152759/new/

https://reviews.llvm.org/D152759



More information about the lldb-commits mailing list