================
@@ -0,0 +1,47 @@
+#include <cstdint>
+#include <cstdio>
+#include <cstring>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+
+// Set up two memory regions to exercise save-core's Memory64List accounting:
+//
+// good - a large, fully-readable region (so the dump uses a Memory64List and
+// there is a real range whose bytes must line up in the shared blob).
+// bad - a read/write region whose tail is unreadable: an anonymous
in-memory
+// file (memfd) one page long, mapped four pages long, so the pages
+// past the file's end fault when read. Reading into that tail fails
+// part-way, which used to make save-core count the partially-read
+// bytes into the range's DataSize even though they were never
written,
+// desyncing the blob. A memfd is used so the test does not touch the
+// filesystem.
+int main() {
+ const size_t page = sysconf(_SC_PAGESIZE);
+
+ const size_t good_size = 2 * 1024 * 1024;
----------------
Jlalond wrote:
Nit: The good bad variable nameing is a bit weird
https://github.com/llvm/llvm-project/pull/212861
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits