#ifndef liblldb_SectionLoadList_h_
#define liblldb_SectionLoadList_h_
#include <map>
#include "llvm/ADT/DenseMap.h"
#include "lldb/lldb-public.h"
#include "lldb/Host/Mutex.h"
namespace lldb_private {
class SectionLoadList
{
public:
SectionLoadList () :
m_addr_to_sect (),
m_sect_to_addr (),
m_mutex (Mutex::eMutexTypeRecursive)
{
}
~SectionLoadList()
{
}
bool
IsEmpty() const;
void
Clear ();
lldb::addr_t
GetSectionLoadAddress (const Section *section) const;
bool
ResolveLoadAddress (lldb::addr_t load_addr, Address &so_addr) const;
bool
SetSectionLoadAddress (const Section *section, lldb::addr_t load_addr);
bool
SetSectionUnloaded (const Section *section, lldb::addr_t load_addr);
size_t
SetSectionUnloaded (const Section *section);
void
Dump (Stream &s, Target *target);
protected:
typedef std::map<lldb::addr_t, const Section *> addr_to_sect_collection;
typedef llvm::DenseMap<const Section *, lldb::addr_t> sect_to_addr_collection;
addr_to_sect_collection m_addr_to_sect;
sect_to_addr_collection m_sect_to_addr;
mutable Mutex m_mutex;
private:
DISALLOW_COPY_AND_ASSIGN (SectionLoadList);
};
}
#endif // liblldb_SectionLoadList_h_