SectionLoadHistory.h [plain text]
#ifndef liblldb_SectionLoadHistory_h_
#define liblldb_SectionLoadHistory_h_
#include <map>
#include "lldb/lldb-public.h"
#include "lldb/Host/Mutex.h"
namespace lldb_private {
class SectionLoadHistory
{
public:
enum {
eStopIDNow = UINT32_MAX
};
SectionLoadHistory () :
m_stop_id_to_section_load_list(),
m_mutex (Mutex::eMutexTypeRecursive)
{
}
~SectionLoadHistory()
{
Clear();
}
SectionLoadList &
GetCurrentSectionLoadList ();
bool
IsEmpty() const;
void
Clear ();
uint32_t
GetLastStopID() const;
lldb::addr_t
GetSectionLoadAddress (uint32_t stop_id,
const lldb::SectionSP §ion_sp);
bool
ResolveLoadAddress (uint32_t stop_id,
lldb::addr_t load_addr,
Address &so_addr);
bool
SetSectionLoadAddress (uint32_t stop_id,
const lldb::SectionSP §ion_sp,
lldb::addr_t load_addr,
bool warn_multiple = false);
bool
SetSectionUnloaded (uint32_t stop_id,
const lldb::SectionSP §ion_sp,
lldb::addr_t load_addr);
size_t
SetSectionUnloaded (uint32_t stop_id,
const lldb::SectionSP §ion_sp);
void
Dump (Stream &s,
Target *target);
protected:
SectionLoadList *
GetSectionLoadListForStopID (uint32_t stop_id, bool read_only);
typedef std::map<uint32_t, lldb::SectionLoadListSP> StopIDToSectionLoadList;
StopIDToSectionLoadList m_stop_id_to_section_load_list;
mutable Mutex m_mutex;
private:
DISALLOW_COPY_AND_ASSIGN (SectionLoadHistory);
};
}
#endif // liblldb_SectionLoadHistory_h_