Skip to content

Commit 78ff340

Browse files
authored
[LLDB][Minidump] Fix bug where we were using the wrong collection for thread stacks (#110579)
In my prior two save core API's, I experimented on how to save stacks with the new API. I incorrectly left these in, as the existing `m_thread_by_range_end` was the correct choice. I have removed the no-op collection, and moved to use the proper one. It's worth noting this was not caught by testing because we do not verify where the items are contained in the minidump. This would require a test being aware of how minidumps are structured, or adding a textual tool that we can then scan the output of.
1 parent 50e5411 commit 78ff340

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ Status MinidumpFileBuilder::AddMemoryList() {
853853
uint64_t total_size = GetCurrentDataEndOffset();
854854
auto iterator = all_core_memory_vec.begin();
855855
while (iterator != all_core_memory_vec.end()) {
856-
if (m_saved_stack_ranges.count(iterator->range.start()) > 0) {
856+
if (m_thread_by_range_end.count(iterator->range.end()) > 0) {
857857
// We don't save stacks twice.
858858
ranges_32.push_back(*iterator);
859859
total_size +=

lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ class MinidumpFileBuilder {
172172
// to duplicate it in the exception data.
173173
std::unordered_map<lldb::tid_t, llvm::minidump::LocationDescriptor>
174174
m_tid_to_reg_ctx;
175-
std::unordered_set<lldb::addr_t> m_saved_stack_ranges;
176175
lldb::FileUP m_core_file;
177176
lldb_private::SaveCoreOptions m_save_core_options;
178177
};

0 commit comments

Comments
 (0)