llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Gabriele Mondada (gmondada)

<details>
<summary>Changes</summary>

Command qModuleInfo (GDB server protocol) can be used to request metadata of 
shared libraries stored in a ZIP archive on the target. This is typically used 
for retrieving SO files bundled in a APK file on Android.

Requesting the last entry in the ZIP file often fails because of a bug in the 
entry search mechanism. This PR fixes this.

NOTE: This is part on an effort to get lldb working for debugging Swift on 
Android: https://github.com/swiftlang/llvm-project/issues/10831

---
Full diff: https://github.com/llvm/llvm-project/pull/173966.diff


1 Files Affected:

- (modified) lldb/source/Utility/ZipFile.cpp (+1-1) 


``````````diff
diff --git a/lldb/source/Utility/ZipFile.cpp b/lldb/source/Utility/ZipFile.cpp
index b8ed956cbfcb2..e47c690e65b0d 100644
--- a/lldb/source/Utility/ZipFile.cpp
+++ b/lldb/source/Utility/ZipFile.cpp
@@ -144,7 +144,7 @@ bool FindFile(lldb::DataBufferSP zip_data, const EocdRecord 
*eocd,
     // Sanity check the file name values.
     auto file_name = reinterpret_cast<const char *>(cd + 1);
     size_t file_name_length = cd->file_name_length;
-    if (file_name + file_name_length >= reinterpret_cast<const char *>(eocd) ||
+    if (file_name + file_name_length > reinterpret_cast<const char *>(eocd) ||
         file_name_length == 0)
       return false;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/173966
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to