blob: e46a285ea4683c2d0dbfd378970f1ecb5916e012 [file] [log] [blame]
Stephen Wilsone6f9f662010-07-24 02:19:04 +00001//===-- ProcessLinux.h ------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_ProcessLinux_H_
11#define liblldb_ProcessLinux_H_
12
13// C Includes
14
15// C++ Includes
16#include <queue>
17
18// Other libraries and framework includes
19#include "lldb/Target/Process.h"
Todd Fialacacde7d2014-09-27 16:54:22 +000020#include "Plugins/Process/POSIX/ProcessMessage.h"
21#include "Plugins/Process/POSIX/ProcessPOSIX.h"
Stephen Wilsone6f9f662010-07-24 02:19:04 +000022
23class ProcessMonitor;
24
25class ProcessLinux :
Johnny Chen30213ff2012-01-05 19:17:38 +000026 public ProcessPOSIX
Stephen Wilsone6f9f662010-07-24 02:19:04 +000027{
28public:
29 //------------------------------------------------------------------
30 // Static functions.
31 //------------------------------------------------------------------
Greg Clayton0c90ef42012-02-21 18:40:07 +000032 static lldb::ProcessSP
Stephen Wilsone6f9f662010-07-24 02:19:04 +000033 CreateInstance(lldb_private::Target& target,
Greg Clayton0c90ef42012-02-21 18:40:07 +000034 lldb_private::Listener &listener,
35 const lldb_private::FileSpec *);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000036
37 static void
38 Initialize();
39
40 static void
41 Terminate();
42
Greg Clayton57abc5d2013-05-10 21:47:16 +000043 static lldb_private::ConstString
Stephen Wilsone6f9f662010-07-24 02:19:04 +000044 GetPluginNameStatic();
45
46 static const char *
47 GetPluginDescriptionStatic();
48
49 //------------------------------------------------------------------
50 // Constructors and destructors
51 //------------------------------------------------------------------
52 ProcessLinux(lldb_private::Target& target,
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +000053 lldb_private::Listener &listener,
54 lldb_private::FileSpec *core_file);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000055
Ed Maste7dcb77d2013-08-30 13:11:30 +000056 virtual lldb_private::Error
57 DoDetach(bool keep_stopped);
58
Greg Claytonc3c0b0e2012-04-12 19:04:34 +000059 virtual bool
Andrew MacPherson6ef17b92014-03-25 21:40:04 +000060 DetachRequiresHalt() { return true; }
61
62 virtual bool
Johnny Chen30213ff2012-01-05 19:17:38 +000063 UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list);
Michael Sartain9f822cd2013-07-31 23:27:46 +000064
Stephen Wilsone6f9f662010-07-24 02:19:04 +000065 //------------------------------------------------------------------
66 // PluginInterface protocol
67 //------------------------------------------------------------------
Greg Clayton57abc5d2013-05-10 21:47:16 +000068 virtual lldb_private::ConstString
Stephen Wilsone6f9f662010-07-24 02:19:04 +000069 GetPluginName();
70
Stephen Wilsone6f9f662010-07-24 02:19:04 +000071 virtual uint32_t
72 GetPluginVersion();
73
74 virtual void
75 GetPluginCommandHelp(const char *command, lldb_private::Stream *strm);
76
77 virtual lldb_private::Error
78 ExecutePluginCommand(lldb_private::Args &command,
79 lldb_private::Stream *strm);
80
81 virtual lldb_private::Log *
82 EnablePluginLogging(lldb_private::Stream *strm,
83 lldb_private::Args &command);
84
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +000085 virtual bool
86 CanDebug(lldb_private::Target &target, bool plugin_specified_by_name);
87
Andrew Kaylor93132f52013-05-28 23:04:25 +000088 //------------------------------------------------------------------
89 // ProcessPOSIX overrides
90 //------------------------------------------------------------------
91 virtual void
92 StopAllThreads(lldb::tid_t stop_tid);
93
Michael Sartain9f822cd2013-07-31 23:27:46 +000094 virtual POSIXThread *
95 CreateNewPOSIXThread(lldb_private::Process &process, lldb::tid_t tid);
96
Stephen Wilsone6f9f662010-07-24 02:19:04 +000097private:
Stephen Wilson84ffe702011-03-30 15:55:52 +000098
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +000099 lldb_private::FileSpec *m_core_file;
100
Andrew Kaylor93132f52013-05-28 23:04:25 +0000101 // Flag to avoid recursion when stopping all threads.
102 bool m_stopping_threads;
Stephen Wilsone6f9f662010-07-24 02:19:04 +0000103};
104
Ed Masteea660072013-12-04 13:41:18 +0000105#endif // liblldb_ProcessLinux_H_