Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 1 | //===-- 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 Fiala | cacde7d | 2014-09-27 16:54:22 +0000 | [diff] [blame] | 20 | #include "Plugins/Process/POSIX/ProcessMessage.h" |
| 21 | #include "Plugins/Process/POSIX/ProcessPOSIX.h" |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 22 | |
| 23 | class ProcessMonitor; |
| 24 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 25 | namespace lldb_private { |
| 26 | namespace process_linux { |
| 27 | |
| 28 | class ProcessLinux : public ProcessPOSIX |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 29 | { |
| 30 | public: |
| 31 | //------------------------------------------------------------------ |
| 32 | // Static functions. |
| 33 | //------------------------------------------------------------------ |
Greg Clayton | 0c90ef4 | 2012-02-21 18:40:07 +0000 | [diff] [blame] | 34 | static lldb::ProcessSP |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 35 | CreateInstance(Target& target, |
| 36 | Listener &listener, |
| 37 | const FileSpec *); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 38 | |
| 39 | static void |
| 40 | Initialize(); |
| 41 | |
| 42 | static void |
| 43 | Terminate(); |
| 44 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 45 | static ConstString |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 46 | GetPluginNameStatic(); |
| 47 | |
| 48 | static const char * |
| 49 | GetPluginDescriptionStatic(); |
| 50 | |
| 51 | //------------------------------------------------------------------ |
| 52 | // Constructors and destructors |
| 53 | //------------------------------------------------------------------ |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 54 | ProcessLinux(Target& target, |
| 55 | Listener &listener, |
| 56 | FileSpec *core_file); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 57 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 58 | Error |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 59 | DoDetach(bool keep_stopped) override; |
Ed Maste | 7dcb77d | 2013-08-30 13:11:30 +0000 | [diff] [blame] | 60 | |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 61 | bool |
| 62 | DetachRequiresHalt() override { return true; } |
Andrew MacPherson | 6ef17b9 | 2014-03-25 21:40:04 +0000 | [diff] [blame] | 63 | |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 64 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 65 | UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) override; |
Michael Sartain | 9f822cd | 2013-07-31 23:27:46 +0000 | [diff] [blame] | 66 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 67 | //------------------------------------------------------------------ |
| 68 | // PluginInterface protocol |
| 69 | //------------------------------------------------------------------ |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 70 | ConstString |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 71 | GetPluginName() override; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 72 | |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 73 | uint32_t |
| 74 | GetPluginVersion() override; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 75 | |
| 76 | virtual void |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 77 | GetPluginCommandHelp(const char *command, Stream *strm); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 78 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 79 | virtual Error |
| 80 | ExecutePluginCommand(Args &command, |
| 81 | Stream *strm); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 82 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 83 | virtual Log * |
| 84 | EnablePluginLogging(Stream *strm, |
| 85 | Args &command); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 86 | |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 87 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 88 | CanDebug(Target &target, bool plugin_specified_by_name) override; |
Ashok Thirumurthi | 4f01ff8 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 89 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 90 | //------------------------------------------------------------------ |
| 91 | // ProcessPOSIX overrides |
| 92 | //------------------------------------------------------------------ |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 93 | void |
| 94 | StopAllThreads(lldb::tid_t stop_tid) override; |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 95 | |
Tamas Berghammer | d542efd | 2015-03-25 15:37:56 +0000 | [diff] [blame] | 96 | POSIXThread * |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 97 | CreateNewPOSIXThread(Process &process, lldb::tid_t tid) override; |
Michael Sartain | 9f822cd | 2013-07-31 23:27:46 +0000 | [diff] [blame] | 98 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 99 | private: |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 100 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 101 | FileSpec *m_core_file; |
Ashok Thirumurthi | 4f01ff8 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 102 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 103 | // Flag to avoid recursion when stopping all threads. |
| 104 | bool m_stopping_threads; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 105 | }; |
| 106 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 107 | } // namespace process_linux |
| 108 | } // namespace lldb_private |
| 109 | |
Ed Maste | ea66007 | 2013-12-04 13:41:18 +0000 | [diff] [blame] | 110 | #endif // liblldb_ProcessLinux_H_ |