blob: da7eb437ba3bee08329b4d5830d296b68a6f5af3 [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"
20#include "ProcessMessage.h"
Johnny Chen30213ff2012-01-05 19:17:38 +000021#include "ProcessPOSIX.h"
Stephen Wilsone6f9f662010-07-24 02:19:04 +000022
Todd Fialaaf245d12014-06-30 21:05:18 +000023#include "Plugins/Process/Utility/LinuxSignals.h"
24
Stephen Wilsone6f9f662010-07-24 02:19:04 +000025class ProcessMonitor;
26
27class ProcessLinux :
Johnny Chen30213ff2012-01-05 19:17:38 +000028 public ProcessPOSIX
Stephen Wilsone6f9f662010-07-24 02:19:04 +000029{
30public:
31 //------------------------------------------------------------------
32 // Static functions.
33 //------------------------------------------------------------------
Greg Clayton0c90ef42012-02-21 18:40:07 +000034 static lldb::ProcessSP
Stephen Wilsone6f9f662010-07-24 02:19:04 +000035 CreateInstance(lldb_private::Target& target,
Greg Clayton0c90ef42012-02-21 18:40:07 +000036 lldb_private::Listener &listener,
37 const lldb_private::FileSpec *);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000038
39 static void
40 Initialize();
41
42 static void
43 Terminate();
44
Greg Clayton57abc5d2013-05-10 21:47:16 +000045 static lldb_private::ConstString
Stephen Wilsone6f9f662010-07-24 02:19:04 +000046 GetPluginNameStatic();
47
48 static const char *
49 GetPluginDescriptionStatic();
50
51 //------------------------------------------------------------------
52 // Constructors and destructors
53 //------------------------------------------------------------------
54 ProcessLinux(lldb_private::Target& target,
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +000055 lldb_private::Listener &listener,
56 lldb_private::FileSpec *core_file);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000057
Ed Maste7dcb77d2013-08-30 13:11:30 +000058 virtual lldb_private::Error
59 DoDetach(bool keep_stopped);
60
Greg Claytonc3c0b0e2012-04-12 19:04:34 +000061 virtual bool
Andrew MacPherson6ef17b92014-03-25 21:40:04 +000062 DetachRequiresHalt() { return true; }
63
64 virtual bool
Johnny Chen30213ff2012-01-05 19:17:38 +000065 UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list);
Michael Sartain9f822cd2013-07-31 23:27:46 +000066
Stephen Wilsone6f9f662010-07-24 02:19:04 +000067 //------------------------------------------------------------------
68 // PluginInterface protocol
69 //------------------------------------------------------------------
Greg Clayton57abc5d2013-05-10 21:47:16 +000070 virtual lldb_private::ConstString
Stephen Wilsone6f9f662010-07-24 02:19:04 +000071 GetPluginName();
72
Stephen Wilsone6f9f662010-07-24 02:19:04 +000073 virtual uint32_t
74 GetPluginVersion();
75
76 virtual void
77 GetPluginCommandHelp(const char *command, lldb_private::Stream *strm);
78
79 virtual lldb_private::Error
80 ExecutePluginCommand(lldb_private::Args &command,
81 lldb_private::Stream *strm);
82
83 virtual lldb_private::Log *
84 EnablePluginLogging(lldb_private::Stream *strm,
85 lldb_private::Args &command);
86
Matt Kopec841a5482013-05-17 22:21:08 +000087 //------------------------------------------------------------------
88 // Plug-in process overrides
89 //------------------------------------------------------------------
90 virtual lldb_private::UnixSignals &
91 GetUnixSignals ()
92 {
93 return m_linux_signals;
94 }
95
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +000096 virtual bool
97 CanDebug(lldb_private::Target &target, bool plugin_specified_by_name);
98
Andrew Kaylor93132f52013-05-28 23:04:25 +000099 //------------------------------------------------------------------
100 // ProcessPOSIX overrides
101 //------------------------------------------------------------------
102 virtual void
103 StopAllThreads(lldb::tid_t stop_tid);
104
Michael Sartain9f822cd2013-07-31 23:27:46 +0000105 virtual POSIXThread *
106 CreateNewPOSIXThread(lldb_private::Process &process, lldb::tid_t tid);
107
Stephen Wilsone6f9f662010-07-24 02:19:04 +0000108private:
Stephen Wilson84ffe702011-03-30 15:55:52 +0000109
110 /// Linux-specific signal set.
Todd Fialaaf245d12014-06-30 21:05:18 +0000111 process_linux::LinuxSignals m_linux_signals;
Stephen Wilson84ffe702011-03-30 15:55:52 +0000112
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +0000113 lldb_private::FileSpec *m_core_file;
114
Andrew Kaylor93132f52013-05-28 23:04:25 +0000115 // Flag to avoid recursion when stopping all threads.
116 bool m_stopping_threads;
Stephen Wilsone6f9f662010-07-24 02:19:04 +0000117};
118
Ed Masteea660072013-12-04 13:41:18 +0000119#endif // liblldb_ProcessLinux_H_