[Lldb-commits] [lldb] r123801 - in /lldb/trunk/source/Plugins/Process/Linux: LinuxThread.cpp Makefile
Stephen Wilson
wilsons at start.ca
Tue Jan 18 17:36:10 PST 2011
Author: wilsons
Date: Tue Jan 18 19:36:10 2011
New Revision: 123801
URL: http://llvm.org/viewvc/llvm-project?rev=123801&view=rev
Log:
Make LinuxThread use the LLDB unwinder.
Modified:
lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
lldb/trunk/source/Plugins/Process/Linux/Makefile
Modified: lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp?rev=123801&r1=123800&r2=123801&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/LinuxThread.cpp Tue Jan 18 19:36:10 2011
@@ -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 @@
}
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 @@
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 @@
LinuxThread::WillResume(lldb::StateType resume_state)
{
SetResumeState(resume_state);
+
+ ClearStackFrames();
+ if (m_unwinder_ap.get())
+ m_unwinder_ap->Clear();
+
return Thread::WillResume(resume_state);
}
Modified: lldb/trunk/source/Plugins/Process/Linux/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/Makefile?rev=123801&r1=123800&r2=123801&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/Makefile (original)
+++ lldb/trunk/source/Plugins/Process/Linux/Makefile Tue Jan 18 19:36:10 2011
@@ -11,4 +11,7 @@
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
More information about the lldb-commits
mailing list