|
35 | 35 | #include "lldb/Host/ProcessLaunchInfo.h" |
36 | 36 | #include "lldb/Host/ProcessRunLock.h" |
37 | 37 | #include "lldb/Symbol/ObjectFile.h" |
38 | | -#include "lldb/Symbol/SaveCoreOptions.h" |
39 | | -#include "lldb/Target/CoreFileMemoryRanges.h" |
40 | 38 | #include "lldb/Target/ExecutionContextScope.h" |
41 | 39 | #include "lldb/Target/InstrumentationRuntime.h" |
42 | 40 | #include "lldb/Target/Memory.h" |
@@ -712,6 +710,29 @@ class Process : public std::enable_shared_from_this<Process>, |
712 | 710 | /// is not supported by the plugin, error otherwise. |
713 | 711 | virtual llvm::Expected<bool> SaveCore(llvm::StringRef outfile); |
714 | 712 |
|
| 713 | + struct CoreFileMemoryRange { |
| 714 | + llvm::AddressRange range; /// The address range to save into the core file. |
| 715 | + uint32_t lldb_permissions; /// A bit set of lldb::Permissions bits. |
| 716 | + |
| 717 | + bool operator==(const CoreFileMemoryRange &rhs) const { |
| 718 | + return range == rhs.range && lldb_permissions == rhs.lldb_permissions; |
| 719 | + } |
| 720 | + |
| 721 | + bool operator!=(const CoreFileMemoryRange &rhs) const { |
| 722 | + return !(*this == rhs); |
| 723 | + } |
| 724 | + |
| 725 | + bool operator<(const CoreFileMemoryRange &rhs) const { |
| 726 | + if (range < rhs.range) |
| 727 | + return true; |
| 728 | + if (range == rhs.range) |
| 729 | + return lldb_permissions < rhs.lldb_permissions; |
| 730 | + return false; |
| 731 | + } |
| 732 | + }; |
| 733 | + |
| 734 | + using CoreFileMemoryRanges = std::vector<CoreFileMemoryRange>; |
| 735 | + |
715 | 736 | /// Helper function for Process::SaveCore(...) that calculates the address |
716 | 737 | /// ranges that should be saved. This allows all core file plug-ins to save |
717 | 738 | /// consistent memory ranges given a \a core_style. |
|
0 commit comments