File indexing completed on 2026-05-10 08:42:54
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_TARGET_SECTIONLOADHISTORY_H
0010 #define LLDB_TARGET_SECTIONLOADHISTORY_H
0011
0012 #include <map>
0013 #include <mutex>
0014
0015 #include "lldb/lldb-public.h"
0016
0017 namespace lldb_private {
0018
0019 class SectionLoadHistory {
0020 public:
0021 enum : unsigned {
0022
0023
0024 eStopIDNow = UINT32_MAX
0025 };
0026
0027 SectionLoadHistory() = default;
0028
0029 ~SectionLoadHistory() {
0030
0031
0032 Clear();
0033 }
0034
0035 SectionLoadList &GetCurrentSectionLoadList();
0036
0037 bool IsEmpty() const;
0038
0039 void Clear();
0040
0041 uint32_t GetLastStopID() const;
0042
0043
0044 lldb::addr_t GetSectionLoadAddress(uint32_t stop_id,
0045 const lldb::SectionSP §ion_sp);
0046
0047 bool ResolveLoadAddress(uint32_t stop_id, lldb::addr_t load_addr,
0048 Address &so_addr, bool allow_section_end = false);
0049
0050 bool SetSectionLoadAddress(uint32_t stop_id,
0051 const lldb::SectionSP §ion_sp,
0052 lldb::addr_t load_addr,
0053 bool warn_multiple = false);
0054
0055
0056
0057
0058 bool SetSectionUnloaded(uint32_t stop_id, const lldb::SectionSP §ion_sp,
0059 lldb::addr_t load_addr);
0060
0061
0062
0063
0064 size_t SetSectionUnloaded(uint32_t stop_id,
0065 const lldb::SectionSP §ion_sp);
0066
0067 void Dump(Stream &s, Target *target);
0068
0069 protected:
0070 SectionLoadList *GetSectionLoadListForStopID(uint32_t stop_id,
0071 bool read_only);
0072
0073 typedef std::map<uint32_t, lldb::SectionLoadListSP> StopIDToSectionLoadList;
0074 StopIDToSectionLoadList m_stop_id_to_section_load_list;
0075 mutable std::recursive_mutex m_mutex;
0076
0077 private:
0078 SectionLoadHistory(const SectionLoadHistory &) = delete;
0079 const SectionLoadHistory &operator=(const SectionLoadHistory &) = delete;
0080 };
0081
0082 }
0083
0084 #endif