[lldb] [llvm] [LLDB][Minidump] Add 64b support to LLDB's minidump file builder. (PR #95312)
Greg Clayton via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 12 21:43:51 PDT 2024
================
@@ -797,20 +822,75 @@ void MinidumpFileBuilder::AddLinuxFileStreams(
}
}
-Status MinidumpFileBuilder::Dump(lldb::FileUP &core_file) const {
- constexpr size_t header_size = sizeof(llvm::minidump::Header);
- constexpr size_t directory_size = sizeof(llvm::minidump::Directory);
+Status MinidumpFileBuilder::AddMemory(const ProcessSP &process_sp,
+ SaveCoreStyle core_style) {
+ Status error;
+
+ Process::CoreFileMemoryRanges ranges_for_memory_list;
+ error = process_sp->CalculateCoreFileSaveRanges(
+ SaveCoreStyle::eSaveCoreStackOnly, ranges_for_memory_list);
+ if (error.Fail()) {
+ return error;
+ }
+
+ std::set<addr_t> stack_ranges;
+ for (const auto &core_range : ranges_for_memory_list) {
+ stack_ranges.insert(core_range.range.start());
+ }
----------------
clayborg wrote:
remove `{}` from single line `for` statement and use `ranges_32` and rename `stack_ranges` to `stack_start_addresses` since that is what we are storing:
```
std::set<addr_t> stack_start_addresses;
for (const auto &core_range : ranges_32)
stack_start_addresses.insert(core_range.range.start());
```
We also need to make sure the current `ranges_32` doesn't exceed 4GB or we must error out since the thread stacks must be under 4GB. Or we can avoid fixing the stack memory descriptor for any threads that exceed the 4GB barrier
https://github.com/llvm/llvm-project/pull/95312
More information about the llvm-commits
mailing list