diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp b/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp index 527168c..1e5c417 100644 --- a/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp +++ b/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp @@ -47,15 +47,7 @@ SectionLoadHistory::GetLastStopID() const SectionLoadList * SectionLoadHistory::GetSectionLoadListForStopID (uint32_t stop_id, bool read_only) { - if (m_stop_id_to_section_load_list.empty()) - { - SectionLoadListSP section_load_list_sp(new SectionLoadList()); - if (stop_id == eStopIDNow) - stop_id = 0; - m_stop_id_to_section_load_list[stop_id] = section_load_list_sp; - return section_load_list_sp.get(); - } - else + if (!m_stop_id_to_section_load_list.empty()) { if (read_only) { @@ -65,7 +57,7 @@ SectionLoadHistory::GetSectionLoadListForStopID (uint32_t stop_id, bool read_onl if (stop_id == eStopIDNow) { // If we are asking for the latest and greatest value, it is always - // at the end of our list becuase that will be the highest stop ID. + // at the end of our list because that will be the highest stop ID. StopIDToSectionLoadList::reverse_iterator rpos = m_stop_id_to_section_load_list.rbegin(); return rpos->second.get(); } @@ -105,13 +97,18 @@ SectionLoadHistory::GetSectionLoadListForStopID (uint32_t stop_id, bool read_onl return section_load_list_sp.get(); } } - return NULL; + SectionLoadListSP section_load_list_sp(new SectionLoadList()); + if (stop_id == eStopIDNow) + stop_id = 0; + m_stop_id_to_section_load_list[stop_id] = section_load_list_sp; + return section_load_list_sp.get(); } SectionLoadList & SectionLoadHistory::GetCurrentSectionLoadList () { const bool read_only = true; + Mutex::Locker locker(m_mutex); SectionLoadList *section_load_list = GetSectionLoadListForStopID (eStopIDNow, read_only); assert(section_load_list != NULL); return *section_load_list; |