summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/Target/Unwind.h54
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindLLDB.h9
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h13
5 files changed, 60 insertions, 28 deletions
diff --git a/lldb/include/lldb/Target/Unwind.h b/lldb/include/lldb/Target/Unwind.h
index 699a73c60cd..47bc83d7031 100644
--- a/lldb/include/lldb/Target/Unwind.h
+++ b/lldb/include/lldb/Target/Unwind.h
@@ -15,6 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
+#include "lldb/Host/Mutex.h"
namespace lldb_private {
@@ -25,7 +26,8 @@ protected:
// Classes that inherit from Unwind can see and modify these
//------------------------------------------------------------------
Unwind(Thread &thread) :
- m_thread (thread)
+ m_thread (thread),
+ m_unwind_mutex()
{
}
@@ -35,20 +37,37 @@ public:
{
}
- virtual void
- Clear() = 0;
+ void
+ Clear()
+ {
+ Mutex::Locker locker(m_unwind_mutex);
+ DoClear();
+
+ }
- virtual uint32_t
- GetFrameCount() = 0;
+ uint32_t
+ GetFrameCount()
+ {
+ Mutex::Locker locker(m_unwind_mutex);
+ return DoGetFrameCount();
+ }
- virtual bool
+ bool
GetFrameInfoAtIndex (uint32_t frame_idx,
lldb::addr_t& cfa,
- lldb::addr_t& pc) = 0;
+ lldb::addr_t& pc)
+ {
+ Mutex::Locker locker(m_unwind_mutex);
+ return DoGetFrameInfoAtIndex (frame_idx, cfa, pc);
+ }
+
+ lldb::RegisterContextSP
+ CreateRegisterContextForFrame (StackFrame *frame)
+ {
+ Mutex::Locker locker(m_unwind_mutex);
+ return DoCreateRegisterContextForFrame (frame);
+ }
- virtual lldb::RegisterContextSP
- CreateRegisterContextForFrame (StackFrame *frame) = 0;
-
Thread &
GetThread()
{
@@ -59,7 +78,22 @@ protected:
//------------------------------------------------------------------
// Classes that inherit from Unwind can see and modify these
//------------------------------------------------------------------
+ virtual void
+ DoClear() = 0;
+
+ virtual uint32_t
+ DoGetFrameCount() = 0;
+
+ virtual bool
+ DoGetFrameInfoAtIndex (uint32_t frame_idx,
+ lldb::addr_t& cfa,
+ lldb::addr_t& pc) = 0;
+
+ virtual lldb::RegisterContextSP
+ DoCreateRegisterContextForFrame (StackFrame *frame) = 0;
+
Thread &m_thread;
+ Mutex m_unwind_mutex;
private:
DISALLOW_COPY_AND_ASSIGN (Unwind);
};
diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp
index 4ed69e85387..d61b6d07c23 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp
@@ -30,7 +30,7 @@ UnwindLLDB::UnwindLLDB (Thread &thread) :
}
uint32_t
-UnwindLLDB::GetFrameCount()
+UnwindLLDB::DoGetFrameCount()
{
if (m_frames.empty())
{
@@ -177,7 +177,7 @@ UnwindLLDB::AddOneMoreFrame (ABI *abi)
}
bool
-UnwindLLDB::GetFrameInfoAtIndex (uint32_t idx, addr_t& cfa, addr_t& pc)
+UnwindLLDB::DoGetFrameInfoAtIndex (uint32_t idx, addr_t& cfa, addr_t& pc)
{
if (m_frames.size() == 0)
{
@@ -200,7 +200,7 @@ UnwindLLDB::GetFrameInfoAtIndex (uint32_t idx, addr_t& cfa, addr_t& pc)
}
lldb::RegisterContextSP
-UnwindLLDB::CreateRegisterContextForFrame (StackFrame *frame)
+UnwindLLDB::DoCreateRegisterContextForFrame (StackFrame *frame)
{
lldb::RegisterContextSP reg_ctx_sp;
uint32_t idx = frame->GetConcreteFrameIndex ();
diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h
index 9625e2e5427..dfd488d8f9c 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h
+++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h
@@ -30,22 +30,23 @@ public:
virtual
~UnwindLLDB() { }
+protected:
void
- Clear()
+ DoClear()
{
m_frames.clear();
}
virtual uint32_t
- GetFrameCount();
+ DoGetFrameCount();
bool
- GetFrameInfoAtIndex (uint32_t frame_idx,
+ DoGetFrameInfoAtIndex (uint32_t frame_idx,
lldb::addr_t& cfa,
lldb::addr_t& start_pc);
lldb::RegisterContextSP
- CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
+ DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame);
private:
struct Cursor
diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
index d09f93b635d..5706c6d2381 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
+++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
@@ -28,7 +28,7 @@ UnwindMacOSXFrameBackchain::UnwindMacOSXFrameBackchain (Thread &thread) :
}
uint32_t
-UnwindMacOSXFrameBackchain::GetFrameCount()
+UnwindMacOSXFrameBackchain::DoGetFrameCount()
{
if (m_cursors.empty())
{
@@ -45,7 +45,7 @@ UnwindMacOSXFrameBackchain::GetFrameCount()
}
bool
-UnwindMacOSXFrameBackchain::GetFrameInfoAtIndex (uint32_t idx, addr_t& cfa, addr_t& pc)
+UnwindMacOSXFrameBackchain::DoGetFrameInfoAtIndex (uint32_t idx, addr_t& cfa, addr_t& pc)
{
const uint32_t frame_count = GetFrameCount();
if (idx < frame_count)
@@ -64,7 +64,7 @@ UnwindMacOSXFrameBackchain::GetFrameInfoAtIndex (uint32_t idx, addr_t& cfa, addr
}
lldb::RegisterContextSP
-UnwindMacOSXFrameBackchain::CreateRegisterContextForFrame (StackFrame *frame)
+UnwindMacOSXFrameBackchain::DoCreateRegisterContextForFrame (StackFrame *frame)
{
lldb::RegisterContextSP reg_ctx_sp;
uint32_t concrete_idx = frame->GetConcreteFrameIndex ();
diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h
index 6a48f5dfd70..5667aaf7462 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h
+++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h
@@ -30,27 +30,24 @@ public:
{
}
+protected:
virtual void
- Clear()
+ DoClear()
{
m_cursors.clear();
}
virtual uint32_t
- GetFrameCount();
+ DoGetFrameCount();
bool
- GetFrameInfoAtIndex (uint32_t frame_idx,
+ DoGetFrameInfoAtIndex (uint32_t frame_idx,
lldb::addr_t& cfa,
lldb::addr_t& pc);
lldb::RegisterContextSP
- CreateRegisterContextForFrame (lldb_private::StackFrame *frame);
-
- lldb_private::Thread &
- GetThread();
+ DoCreateRegisterContextForFrame (lldb_private::StackFrame *frame);
-protected:
friend class RegisterContextMacOSXFrameBackchain;
struct Cursor
OpenPOWER on IntegriCloud