#include <map>
#include "lldb/lldb-private.h"
+#include "lldb/Host/Mutex.h"
namespace lldb_private {
collection m_unwinds;
bool m_initialized; // delay some initialization until ObjectFile is set up
+ Mutex m_mutex;
DWARFCallFrameInfo* m_eh_frame;
lldb::StackFrameListSP
HistoryThread::GetStackFrameList ()
{
- Mutex::Locker (m_framelist_mutex);
+ Mutex::Locker locker(m_framelist_mutex);
if (m_framelist.get() == NULL)
{
m_framelist.reset (new StackFrameList (*this, StackFrameListSP(), true));
bool
HistoryUnwind::DoGetFrameInfoAtIndex (uint32_t frame_idx, lldb::addr_t& cfa, lldb::addr_t& pc)
{
- Mutex::Locker (m_unwind_mutex);
+ Mutex::Locker locker(m_unwind_mutex);
if (frame_idx < m_pcs.size())
{
cfa = frame_idx;
m_object_file (objfile),
m_unwinds (),
m_initialized (false),
+ m_mutex (),
m_eh_frame (nullptr)
{
}
if (m_initialized)
return;
+ Mutex::Locker locker(m_mutex);
+
+ if (m_initialized) // check again once we've acquired the lock
+ return;
+
SectionList* sl = m_object_file.GetSectionList ();
if (sl)
{
Initialize();
+ Mutex::Locker locker(m_mutex);
+
// There is an UnwindTable per object file, so we can safely use file handles
addr_t file_addr = addr.GetFileAddress();
iterator end = m_unwinds.end ();
void
UnwindTable::Dump (Stream &s)
{
+ Mutex::Locker locker(m_mutex);
s.Printf("UnwindTable for '%s':\n", m_object_file.GetFileSpec().GetPath().c_str());
const_iterator begin = m_unwinds.begin();
const_iterator end = m_unwinds.end();