diff options
author | Stephen Wilson <wilsons@start.ca> | 2011-01-19 01:36:10 +0000 |
---|---|---|
committer | Stephen Wilson <wilsons@start.ca> | 2011-01-19 01:36:10 +0000 |
commit | 771ec8006cedf9be93a1ff9475577e1d4bc663b0 (patch) | |
tree | 2082feb44b04b8eda77d588bee5c4b77cf7d5ef8 | |
parent | 02e8f8fdc9a32bc2c3621840de1ca0b3df8b1d5e (diff) | |
download | bcm5719-llvm-771ec8006cedf9be93a1ff9475577e1d4bc663b0.tar.gz bcm5719-llvm-771ec8006cedf9be93a1ff9475577e1d4bc663b0.zip |
Make LinuxThread use the LLDB unwinder.
llvm-svn: 123801
-rw-r--r-- | lldb/source/Plugins/Process/Linux/LinuxThread.cpp | 17 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Linux/Makefile | 3 |
2 files changed, 17 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp index b7b2df1ec5b..5c278d44893 100644 --- a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp +++ b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp @@ -7,9 +7,9 @@ // //===----------------------------------------------------------------------===// +// C Includes #include <errno.h> -// C Includes // C++ Includes // Other libraries and framework includes #include "lldb/Target/Process.h" @@ -20,6 +20,7 @@ #include "ProcessLinux.h" #include "ProcessMonitor.h" #include "RegisterContextLinux_x86_64.h" +#include "UnwindLLDB.h" using namespace lldb_private; @@ -91,17 +92,19 @@ LinuxThread::RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint) } lldb::RegisterContextSP -LinuxThread::CreateRegisterContextForFrame (lldb_private::StackFrame *frame) +LinuxThread::CreateRegisterContextForFrame(lldb_private::StackFrame *frame) { lldb::RegisterContextSP reg_ctx_sp; uint32_t concrete_frame_idx = 0; + if (frame) concrete_frame_idx = frame->GetConcreteFrameIndex(); if (concrete_frame_idx == 0) reg_ctx_sp = GetRegisterContext(); else - reg_ctx_sp.reset (new RegisterContextLinux_x86_64(*this, frame->GetConcreteFrameIndex())); + reg_ctx_sp = GetUnwinder()->CreateRegisterContextForFrame(frame); + return reg_ctx_sp; } @@ -118,6 +121,9 @@ LinuxThread::GetPrivateStopReason() Unwind * LinuxThread::GetUnwinder() { + if (m_unwinder_ap.get() == NULL) + m_unwinder_ap.reset(new UnwindLLDB(*this)); + return m_unwinder_ap.get(); } @@ -125,6 +131,11 @@ bool LinuxThread::WillResume(lldb::StateType resume_state) { SetResumeState(resume_state); + + ClearStackFrames(); + if (m_unwinder_ap.get()) + m_unwinder_ap->Clear(); + return Thread::WillResume(resume_state); } diff --git a/lldb/source/Plugins/Process/Linux/Makefile b/lldb/source/Plugins/Process/Linux/Makefile index 0454e6d3415..d2260f5cad3 100644 --- a/lldb/source/Plugins/Process/Linux/Makefile +++ b/lldb/source/Plugins/Process/Linux/Makefile @@ -11,4 +11,7 @@ LLDB_LEVEL := ../../../.. LIBRARYNAME := lldbPluginProcessLinux BUILD_ARCHIVE = 1 +# Extend the include path so we may locate UnwindLLDB.h +CPPFLAGS += -I $(LLDB_LEVEL)/source/Plugins/Utility + include $(LLDB_LEVEL)/Makefile |