blob: 1d8232d3bee9f4c3ac35392650c962c0f3d9e92f [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
Tamas Berghammerdb264a62015-03-31 09:52:22 +000025namespace lldb_private {
26namespace process_linux {
27
28class ProcessLinux : 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
Tamas Berghammerdb264a62015-03-31 09:52:22 +000035 CreateInstance(Target& target,
36 Listener &listener,
37 const FileSpec *);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000038
39 static void
40 Initialize();
41
42 static void
43 Terminate();
44
Tamas Berghammerdb264a62015-03-31 09:52:22 +000045 static ConstString
Stephen Wilsone6f9f662010-07-24 02:19:04 +000046 GetPluginNameStatic();
47
48 static const char *
49 GetPluginDescriptionStatic();
50
51 //------------------------------------------------------------------
52 // Constructors and destructors
53 //------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +000054 ProcessLinux(Target& target,
55 Listener &listener,
56 FileSpec *core_file);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000057
Tamas Berghammerdb264a62015-03-31 09:52:22 +000058 Error
Tamas Berghammerd542efd2015-03-25 15:37:56 +000059 DoDetach(bool keep_stopped) override;
Ed Maste7dcb77d2013-08-30 13:11:30 +000060
Tamas Berghammerd542efd2015-03-25 15:37:56 +000061 bool
62 DetachRequiresHalt() override { return true; }
Andrew MacPherson6ef17b92014-03-25 21:40:04 +000063
Tamas Berghammerd542efd2015-03-25 15:37:56 +000064 bool
Tamas Berghammerdb264a62015-03-31 09:52:22 +000065 UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) override;
Michael Sartain9f822cd2013-07-31 23:27:46 +000066
Stephen Wilsone6f9f662010-07-24 02:19:04 +000067 //------------------------------------------------------------------
68 // PluginInterface protocol
69 //------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +000070 ConstString
Tamas Berghammerd542efd2015-03-25 15:37:56 +000071 GetPluginName() override;
Stephen Wilsone6f9f662010-07-24 02:19:04 +000072
Tamas Berghammerd542efd2015-03-25 15:37:56 +000073 uint32_t
74 GetPluginVersion() override;
Stephen Wilsone6f9f662010-07-24 02:19:04 +000075
76 virtual void
Tamas Berghammerdb264a62015-03-31 09:52:22 +000077 GetPluginCommandHelp(const char *command, Stream *strm);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000078
Tamas Berghammerdb264a62015-03-31 09:52:22 +000079 virtual Error
80 ExecutePluginCommand(Args &command,
81 Stream *strm);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000082
Tamas Berghammerdb264a62015-03-31 09:52:22 +000083 virtual Log *
84 EnablePluginLogging(Stream *strm,
85 Args &command);
Stephen Wilsone6f9f662010-07-24 02:19:04 +000086
Tamas Berghammerd542efd2015-03-25 15:37:56 +000087 bool
Tamas Berghammerdb264a62015-03-31 09:52:22 +000088 CanDebug(Target &target, bool plugin_specified_by_name) override;
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +000089
Andrew Kaylor93132f52013-05-28 23:04:25 +000090 //------------------------------------------------------------------
91 // ProcessPOSIX overrides
92 //------------------------------------------------------------------
Tamas Berghammerd542efd2015-03-25 15:37:56 +000093 void
94 StopAllThreads(lldb::tid_t stop_tid) override;
Andrew Kaylor93132f52013-05-28 23:04:25 +000095
Tamas Berghammerd542efd2015-03-25 15:37:56 +000096 POSIXThread *
Tamas Berghammerdb264a62015-03-31 09:52:22 +000097 CreateNewPOSIXThread(Process &process, lldb::tid_t tid) override;
Michael Sartain9f822cd2013-07-31 23:27:46 +000098
Stephen Wilsone6f9f662010-07-24 02:19:04 +000099private:
Stephen Wilson84ffe702011-03-30 15:55:52 +0000100
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000101 FileSpec *m_core_file;
Ashok Thirumurthi4f01ff82013-07-17 16:06:12 +0000102
Andrew Kaylor93132f52013-05-28 23:04:25 +0000103 // Flag to avoid recursion when stopping all threads.
104 bool m_stopping_threads;
Stephen Wilsone6f9f662010-07-24 02:19:04 +0000105};
106
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000107} // namespace process_linux
108} // namespace lldb_private
109
Ed Masteea660072013-12-04 13:41:18 +0000110#endif // liblldb_ProcessLinux_H_