1 //===-- LoadedModuleInfoList.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_LoadedModuleInfoList_h_
11 #define liblldb_LoadedModuleInfoList_h_
18 // Other libraries and framework includes
19 #include "lldb/lldb-private-forward.h"
21 namespace lldb_private {
22 class LoadedModuleInfoList {
24 class LoadedModuleInfo {
35 for (uint32_t i = 0; i < e_num; ++i)
39 void set_name(const std::string &name) {
41 m_has[e_has_name] = true;
43 bool get_name(std::string &out) const {
45 return m_has[e_has_name];
48 void set_base(const lldb::addr_t base) {
50 m_has[e_has_base] = true;
52 bool get_base(lldb::addr_t &out) const {
54 return m_has[e_has_base];
57 void set_base_is_offset(bool is_offset) { m_base_is_offset = is_offset; }
58 bool get_base_is_offset(bool &out) const {
59 out = m_base_is_offset;
60 return m_has[e_has_base];
63 void set_link_map(const lldb::addr_t addr) {
65 m_has[e_has_link_map] = true;
67 bool get_link_map(lldb::addr_t &out) const {
69 return m_has[e_has_link_map];
72 void set_dynamic(const lldb::addr_t addr) {
74 m_has[e_has_dynamic] = true;
76 bool get_dynamic(lldb::addr_t &out) const {
78 return m_has[e_has_dynamic];
81 bool has_info(e_data_point datum) const {
82 assert(datum < e_num);
86 bool operator==(LoadedModuleInfo const &rhs) const {
87 if (e_num != rhs.e_num)
90 for (size_t i = 0; i < e_num; ++i) {
91 if (m_has[i] != rhs.m_has[i])
95 return (m_base == rhs.m_base) && (m_link_map == rhs.m_link_map) &&
96 (m_dynamic == rhs.m_dynamic) && (m_name == rhs.m_name);
102 lldb::addr_t m_link_map;
104 bool m_base_is_offset;
105 lldb::addr_t m_dynamic;
108 LoadedModuleInfoList() : m_list(), m_link_map(LLDB_INVALID_ADDRESS) {}
110 void add(const LoadedModuleInfo &mod) { m_list.push_back(mod); }
112 void clear() { m_list.clear(); }
114 std::vector<LoadedModuleInfo> m_list;
115 lldb::addr_t m_link_map;
117 } // namespace lldb_private
119 #endif // liblldb_LoadedModuleInfoList_h_