[all-commits] [llvm/llvm-project] a27164: [LLDB][Minidump] Add 64b support to LLDB's minidum...
Jacob Lalonde via All-commits
all-commits at lists.llvm.org
Mon Jun 24 10:48:23 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a27164cb33162bb42642c091703f9c6f8829785c
https://github.com/llvm/llvm-project/commit/a27164cb33162bb42642c091703f9c6f8829785c
Author: Jacob Lalonde <jalalonde at fb.com>
Date: 2024-06-24 (Mon, 24 Jun 2024)
Changed paths:
M lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
M lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h
M lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp
M llvm/include/llvm/BinaryFormat/Minidump.h
Log Message:
-----------
[LLDB][Minidump] Add 64b support to LLDB's minidump file builder. (#95312)
Currently, LLDB does not support taking a minidump over the 4.2gb limit imposed by uint32. In fact, currently it writes the RVA's and the headers to the end of the file, which can become corrupted due to the header offset only supporting a 32b offset.
This change reorganizes how the file structure is laid out. LLDB will precalculate the number of directories required and preallocate space at the top of the file to fill in later. Additionally, thread stacks require a 32b offset, and we provision empty descriptors and keep track of them to clean up once we write the 32b memory list.
For
[MemoryList64](https://learn.microsoft.com/en-us/windows/win32/api/minidumpapiset/ns-minidumpapiset-minidump_memory64_list),
the RVA to the start of the section itself will remain in a 32b addressable space. We achieve this by predetermining the space the memory regions will take, and only writing up to 4.2 gb of data with some buffer to allow all the MemoryDescriptor64s to also still be 32b addressable.
I did not add any explicit tests to this PR because allocating 4.2gb+ to test is very expensive. However, we have 32b automation tests and I validated with in several ways, including with 5gb+ array/object and would be willing to add this as a test case.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list