|
21 | 21 | #include "lldb/Target/ThreadList.h" |
22 | 22 | #include "lldb/Utility/DataExtractor.h" |
23 | 23 | #include "lldb/Utility/LLDBLog.h" |
| 24 | +#include "lldb/Utility/Log.h" |
24 | 25 | #include "lldb/Utility/RegisterValue.h" |
25 | 26 |
|
26 | 27 | #include "llvm/ADT/StringRef.h" |
@@ -663,14 +664,20 @@ MinidumpFileBuilder::AddMemoryList(const lldb::ProcessSP &process_sp, |
663 | 664 | DataBufferHeap helper_data; |
664 | 665 | std::vector<MemoryDescriptor> mem_descriptors; |
665 | 666 | for (const auto &core_range : core_ranges) { |
666 | | - // Skip empty memory regions or any regions with no permissions. |
667 | | - if (core_range.range.empty() || core_range.lldb_permissions == 0) |
| 667 | + // Skip empty memory regions. |
| 668 | + if (core_range.range.empty()) |
668 | 669 | continue; |
669 | 670 | const addr_t addr = core_range.range.start(); |
670 | 671 | const addr_t size = core_range.range.size(); |
671 | 672 | auto data_up = std::make_unique<DataBufferHeap>(size, 0); |
672 | 673 | const size_t bytes_read = |
673 | 674 | process_sp->ReadMemory(addr, data_up->GetBytes(), size, error); |
| 675 | + if (error.Fail()) { |
| 676 | + Log *log = GetLog(LLDBLog::Object); |
| 677 | + LLDB_LOGF(log, "Failed to read memory region. Bytes read: %zu, error: %s", |
| 678 | + bytes_read, error.AsCString()); |
| 679 | + error.Clear(); |
| 680 | + } |
674 | 681 | if (bytes_read == 0) |
675 | 682 | continue; |
676 | 683 | // We have a good memory region with valid bytes to store. |
|
0 commit comments