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 | |
| 25 | class ProcessLinux : |
Johnny Chen | 30213ff | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 26 | public ProcessPOSIX |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 27 | { |
| 28 | public: |
| 29 | //------------------------------------------------------------------ |
| 30 | // Static functions. |
| 31 | //------------------------------------------------------------------ |
Greg Clayton | 0c90ef4 | 2012-02-21 18:40:07 +0000 | [diff] [blame] | 32 | static lldb::ProcessSP |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 33 | CreateInstance(lldb_private::Target& target, |
Greg Clayton | 0c90ef4 | 2012-02-21 18:40:07 +0000 | [diff] [blame] | 34 | lldb_private::Listener &listener, |
| 35 | const lldb_private::FileSpec *); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 36 | |
| 37 | static void |
| 38 | Initialize(); |
| 39 | |
| 40 | static void |
| 41 | Terminate(); |
| 42 | |
Greg Clayton | 57abc5d | 2013-05-10 21:47:16 +0000 | [diff] [blame] | 43 | static lldb_private::ConstString |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 44 | GetPluginNameStatic(); |
| 45 | |
| 46 | static const char * |
| 47 | GetPluginDescriptionStatic(); |
| 48 | |
| 49 | //------------------------------------------------------------------ |
| 50 | // Constructors and destructors |
| 51 | //------------------------------------------------------------------ |
| 52 | ProcessLinux(lldb_private::Target& target, |
Ashok Thirumurthi | 4f01ff8 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 53 | lldb_private::Listener &listener, |
| 54 | lldb_private::FileSpec *core_file); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 55 | |
Ed Maste | 7dcb77d | 2013-08-30 13:11:30 +0000 | [diff] [blame] | 56 | virtual lldb_private::Error |
| 57 | DoDetach(bool keep_stopped); |
| 58 | |
Greg Clayton | c3c0b0e | 2012-04-12 19:04:34 +0000 | [diff] [blame] | 59 | virtual bool |
Andrew MacPherson | 6ef17b9 | 2014-03-25 21:40:04 +0000 | [diff] [blame] | 60 | DetachRequiresHalt() { return true; } |
| 61 | |
| 62 | virtual bool |
Johnny Chen | 30213ff | 2012-01-05 19:17:38 +0000 | [diff] [blame] | 63 | UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list); |
Michael Sartain | 9f822cd | 2013-07-31 23:27:46 +0000 | [diff] [blame] | 64 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 65 | //------------------------------------------------------------------ |
| 66 | // PluginInterface protocol |
| 67 | //------------------------------------------------------------------ |
Greg Clayton | 57abc5d | 2013-05-10 21:47:16 +0000 | [diff] [blame] | 68 | virtual lldb_private::ConstString |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 69 | GetPluginName(); |
| 70 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 71 | 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 Thirumurthi | 4f01ff8 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 85 | virtual bool |
| 86 | CanDebug(lldb_private::Target &target, bool plugin_specified_by_name); |
| 87 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 88 | //------------------------------------------------------------------ |
| 89 | // ProcessPOSIX overrides |
| 90 | //------------------------------------------------------------------ |
| 91 | virtual void |
| 92 | StopAllThreads(lldb::tid_t stop_tid); |
| 93 | |
Michael Sartain | 9f822cd | 2013-07-31 23:27:46 +0000 | [diff] [blame] | 94 | virtual POSIXThread * |
| 95 | CreateNewPOSIXThread(lldb_private::Process &process, lldb::tid_t tid); |
| 96 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 97 | private: |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 98 | |
Ashok Thirumurthi | 4f01ff8 | 2013-07-17 16:06:12 +0000 | [diff] [blame] | 99 | lldb_private::FileSpec *m_core_file; |
| 100 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 101 | // Flag to avoid recursion when stopping all threads. |
| 102 | bool m_stopping_threads; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 103 | }; |
| 104 | |
Ed Maste | ea66007 | 2013-12-04 13:41:18 +0000 | [diff] [blame] | 105 | #endif // liblldb_ProcessLinux_H_ |