summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-11-26 16:48:12 +0000
committeremaste <emaste@FreeBSD.org>2014-11-26 16:48:12 +0000
commit0147dda7de9580d13778ecb4c9e92b83b7a63911 (patch)
treeb16dc95f693ed59342b6141cd3fd9f59a6cd7e7e /contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp
parentbfd4c39c61ae9b29542625bb12b6f7f4b1f8c727 (diff)
parent01ee1789d6aa7294e5966a97f8d29387f6f81699 (diff)
downloadFreeBSD-src-0147dda7de9580d13778ecb4c9e92b83b7a63911.zip
FreeBSD-src-0147dda7de9580d13778ecb4c9e92b83b7a63911.tar.gz
Update LLDB snapshot to upstream r216948 (git 50f7fe44)
This is approximately "LLDB 3.5" although with a little bit of skew, and will go along with the Clang 3.5 import. Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Target/SectionLoadHistory.cpp19
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;
OpenPOWER on IntegriCloud