Add a new Process plugin for Linux.

This component is still at an early stage, but allows for simple
breakpoint/step-over operations and basic process control.

The makefiles are set up to build the plugin under Linux only.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109318 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Linux/LinuxThread.h b/source/Plugins/Process/Linux/LinuxThread.h
new file mode 100644
index 0000000..79ccd0a
--- /dev/null
+++ b/source/Plugins/Process/Linux/LinuxThread.h
@@ -0,0 +1,89 @@
+//===-- LinuxThread.h -------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_LinuxThread_H_
+#define liblldb_LinuxThread_H_
+
+// C Includes
+// C++ Includes
+#include <memory>
+
+// Other libraries and framework includes
+#include "lldb/Target/Thread.h"
+#include "RegisterContextLinux.h"
+
+class ProcessMonitor;
+
+//------------------------------------------------------------------------------
+// @class LinuxThread
+// @brief Abstraction of a linux process (thread).
+class LinuxThread
+    : public lldb_private::Thread
+{
+public:
+    LinuxThread(lldb_private::Process &process, lldb::tid_t tid);
+
+    void
+    RefreshStateAfterStop();
+
+    bool
+    WillResume(lldb::StateType resume_state);
+
+    const char *
+    GetInfo();
+
+    uint32_t
+    GetStackFrameCount();
+
+    lldb::StackFrameSP
+    GetStackFrameAtIndex(uint32_t idx);
+
+    RegisterContextLinux *
+    GetRegisterContext();
+
+    bool
+    SaveFrameZeroState(RegisterCheckpoint &checkpoint);
+
+    bool
+    RestoreSaveFrameZero(const RegisterCheckpoint &checkpoint);
+
+    RegisterContextLinux *
+    CreateRegisterContextForFrame(lldb_private::StackFrame *frame);
+
+    bool
+    GetRawStopReason(StopInfo *stop_info);
+
+    //--------------------------------------------------------------------------
+    // These methods form a specialized interface to linux threads.
+    //
+    bool Resume();
+
+    void BreakNotify();
+    void TraceNotify();
+    void ExitNotify();
+
+private:
+    std::auto_ptr<lldb_private::StackFrame> m_frame_ap;
+    std::auto_ptr<RegisterContextLinux> m_register_ap;
+
+    lldb::BreakpointSiteSP m_breakpoint;
+
+    enum Notification {
+        eNone,
+        eBreak,
+        eTrace,
+        eExit
+    };
+
+    Notification m_note;
+
+    ProcessMonitor &GetMonitor();
+};
+
+#endif // #ifndef liblldb_LinuxThread_H_