Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 1 | //===-- ProcessMonitor.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_ProcessMonitor_H_ |
| 11 | #define liblldb_ProcessMonitor_H_ |
| 12 | |
| 13 | // C Includes |
| 14 | #include <semaphore.h> |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 15 | #include <signal.h> |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 16 | |
| 17 | // C++ Includes |
| 18 | // Other libraries and framework includes |
| 19 | #include "lldb/lldb-types.h" |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 20 | #include "lldb/Host/HostThread.h" |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 21 | #include "lldb/Host/Mutex.h" |
| 22 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 23 | namespace lldb_private { |
| 24 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 25 | class Error; |
| 26 | class Module; |
| 27 | class Scalar; |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 28 | |
| 29 | namespace process_linux { |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 30 | |
| 31 | class ProcessLinux; |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 32 | |
| 33 | } // namespace process_linux |
| 34 | |
| 35 | } // namespace lldb_private |
| 36 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 37 | class Operation; |
| 38 | |
| 39 | /// @class ProcessMonitor |
| 40 | /// @brief Manages communication with the inferior (debugee) process. |
| 41 | /// |
| 42 | /// Upon construction, this class prepares and launches an inferior process for |
| 43 | /// debugging. |
| 44 | /// |
| 45 | /// Changes in the inferior process state are propagated to the associated |
| 46 | /// ProcessLinux instance by calling ProcessLinux::SendMessage with the |
| 47 | /// appropriate ProcessMessage events. |
| 48 | /// |
| 49 | /// A purposely minimal set of operations are provided to interrogate and change |
| 50 | /// the inferior process state. |
| 51 | class ProcessMonitor |
| 52 | { |
| 53 | public: |
| 54 | |
| 55 | /// Launches an inferior process ready for debugging. Forms the |
| 56 | /// implementation of Process::DoLaunch. |
Andrew Kaylor | 6578cb6 | 2013-07-09 22:36:48 +0000 | [diff] [blame] | 57 | ProcessMonitor(ProcessPOSIX *process, |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 58 | lldb_private::Module *module, |
| 59 | char const *argv[], |
| 60 | char const *envp[], |
| 61 | const char *stdin_path, |
| 62 | const char *stdout_path, |
| 63 | const char *stderr_path, |
Daniel Malea | 6217d2a | 2013-01-08 14:49:22 +0000 | [diff] [blame] | 64 | const char *working_dir, |
Todd Fiala | 0bce1b6 | 2014-08-17 00:10:50 +0000 | [diff] [blame] | 65 | const lldb_private::ProcessLaunchInfo &launch_info, |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 66 | lldb_private::Error &error); |
| 67 | |
Andrew Kaylor | 6578cb6 | 2013-07-09 22:36:48 +0000 | [diff] [blame] | 68 | ProcessMonitor(ProcessPOSIX *process, |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 69 | lldb::pid_t pid, |
| 70 | lldb_private::Error &error); |
| 71 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 72 | ~ProcessMonitor(); |
| 73 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 74 | enum ResumeSignals |
| 75 | { |
| 76 | eResumeSignalNone = 0 |
| 77 | }; |
| 78 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 79 | /// Provides the process number of debugee. |
| 80 | lldb::pid_t |
| 81 | GetPID() const { return m_pid; } |
| 82 | |
| 83 | /// Returns the process associated with this ProcessMonitor. |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 84 | lldb_private::process_linux::ProcessLinux & |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 85 | GetProcess() { return *m_process; } |
| 86 | |
Greg Clayton | 710dd5a | 2011-01-08 20:28:42 +0000 | [diff] [blame] | 87 | /// Returns a file descriptor to the controlling terminal of the inferior |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 88 | /// process. |
| 89 | /// |
Greg Clayton | 710dd5a | 2011-01-08 20:28:42 +0000 | [diff] [blame] | 90 | /// Reads from this file descriptor yield both the standard output and |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 91 | /// standard error of this debugee. Even if stderr and stdout were |
| 92 | /// redirected on launch it may still happen that data is available on this |
Pavel Labath | 3a2da9e | 2015-02-06 11:32:52 +0000 | [diff] [blame] | 93 | /// descriptor (if the inferior process opens /dev/tty, for example). This descriptor is |
| 94 | /// closed after a call to StopMonitor(). |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 95 | /// |
| 96 | /// If this monitor was attached to an existing process this method returns |
| 97 | /// -1. |
| 98 | int |
| 99 | GetTerminalFD() const { return m_terminal_fd; } |
| 100 | |
| 101 | /// Reads @p size bytes from address @vm_adder in the inferior process |
| 102 | /// address space. |
| 103 | /// |
| 104 | /// This method is provided to implement Process::DoReadMemory. |
| 105 | size_t |
| 106 | ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, |
| 107 | lldb_private::Error &error); |
| 108 | |
| 109 | /// Writes @p size bytes from address @p vm_adder in the inferior process |
| 110 | /// address space. |
| 111 | /// |
| 112 | /// This method is provided to implement Process::DoWriteMemory. |
| 113 | size_t |
| 114 | WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, |
| 115 | lldb_private::Error &error); |
| 116 | |
| 117 | /// Reads the contents from the register identified by the given (architecture |
| 118 | /// dependent) offset. |
| 119 | /// |
| 120 | /// This method is provided for use by RegisterContextLinux derivatives. |
| 121 | bool |
Ashok Thirumurthi | acbb1a5 | 2013-05-09 19:59:47 +0000 | [diff] [blame] | 122 | ReadRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name, |
Daniel Malea | f0da371 | 2012-12-18 19:50:15 +0000 | [diff] [blame] | 123 | unsigned size, lldb_private::RegisterValue &value); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 124 | |
| 125 | /// Writes the given value to the register identified by the given |
| 126 | /// (architecture dependent) offset. |
| 127 | /// |
| 128 | /// This method is provided for use by RegisterContextLinux derivatives. |
| 129 | bool |
Ashok Thirumurthi | acbb1a5 | 2013-05-09 19:59:47 +0000 | [diff] [blame] | 130 | WriteRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name, |
Daniel Malea | f0da371 | 2012-12-18 19:50:15 +0000 | [diff] [blame] | 131 | const lldb_private::RegisterValue &value); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 132 | |
Stephen Wilson | ade1aea | 2011-01-19 01:31:38 +0000 | [diff] [blame] | 133 | /// Reads all general purpose registers into the specified buffer. |
| 134 | bool |
Matt Kopec | 7de4846 | 2013-03-06 17:20:48 +0000 | [diff] [blame] | 135 | ReadGPR(lldb::tid_t tid, void *buf, size_t buf_size); |
Stephen Wilson | ade1aea | 2011-01-19 01:31:38 +0000 | [diff] [blame] | 136 | |
Matt Kopec | 58c0b96 | 2013-03-20 20:34:35 +0000 | [diff] [blame] | 137 | /// Reads generic floating point registers into the specified buffer. |
Stephen Wilson | ade1aea | 2011-01-19 01:31:38 +0000 | [diff] [blame] | 138 | bool |
Matt Kopec | 7de4846 | 2013-03-06 17:20:48 +0000 | [diff] [blame] | 139 | ReadFPR(lldb::tid_t tid, void *buf, size_t buf_size); |
Stephen Wilson | ade1aea | 2011-01-19 01:31:38 +0000 | [diff] [blame] | 140 | |
Omair Javaid | ea8c25a80 | 2015-05-15 06:29:58 +0000 | [diff] [blame^] | 141 | #if defined (__arm64__) || defined (__aarch64__) |
| 142 | /// Reads hardware breakpoints and watchpoints capability information. |
| 143 | bool |
| 144 | ReadHardwareDebugInfo (lldb::tid_t tid, unsigned int &watch_count , |
| 145 | unsigned int &break_count); |
| 146 | |
| 147 | /// Write hardware breakpoint/watchpoint control and address registers. |
| 148 | bool |
| 149 | WriteHardwareDebugRegs (lldb::tid_t tid, lldb::addr_t *addr_buf, |
| 150 | uint32_t *cntrl_buf, int type, int count); |
| 151 | #endif |
| 152 | |
Matt Kopec | 58c0b96 | 2013-03-20 20:34:35 +0000 | [diff] [blame] | 153 | /// Reads the specified register set into the specified buffer. |
| 154 | /// For instance, the extended floating-point register set. |
| 155 | bool |
| 156 | ReadRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset); |
| 157 | |
Peter Collingbourne | 10bc010 | 2011-06-03 20:41:02 +0000 | [diff] [blame] | 158 | /// Writes all general purpose registers into the specified buffer. |
| 159 | bool |
Matt Kopec | 7de4846 | 2013-03-06 17:20:48 +0000 | [diff] [blame] | 160 | WriteGPR(lldb::tid_t tid, void *buf, size_t buf_size); |
Peter Collingbourne | 10bc010 | 2011-06-03 20:41:02 +0000 | [diff] [blame] | 161 | |
Matt Kopec | 58c0b96 | 2013-03-20 20:34:35 +0000 | [diff] [blame] | 162 | /// Writes generic floating point registers into the specified buffer. |
Peter Collingbourne | 10bc010 | 2011-06-03 20:41:02 +0000 | [diff] [blame] | 163 | bool |
Matt Kopec | 7de4846 | 2013-03-06 17:20:48 +0000 | [diff] [blame] | 164 | WriteFPR(lldb::tid_t tid, void *buf, size_t buf_size); |
Peter Collingbourne | 10bc010 | 2011-06-03 20:41:02 +0000 | [diff] [blame] | 165 | |
Matt Kopec | 58c0b96 | 2013-03-20 20:34:35 +0000 | [diff] [blame] | 166 | /// Writes the specified register set into the specified buffer. |
| 167 | /// For instance, the extended floating-point register set. |
| 168 | bool |
| 169 | WriteRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset); |
| 170 | |
Richard Mitton | 0a55835 | 2013-10-17 21:14:00 +0000 | [diff] [blame] | 171 | /// Reads the value of the thread-specific pointer for a given thread ID. |
| 172 | bool |
| 173 | ReadThreadPointer(lldb::tid_t tid, lldb::addr_t &value); |
| 174 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 175 | /// Writes a siginfo_t structure corresponding to the given thread ID to the |
| 176 | /// memory region pointed to by @p siginfo. |
| 177 | bool |
Daniel Malea | a35970a | 2012-11-23 18:09:58 +0000 | [diff] [blame] | 178 | GetSignalInfo(lldb::tid_t tid, void *siginfo, int &ptrace_err); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 179 | |
| 180 | /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG) |
| 181 | /// corresponding to the given thread IDto the memory pointed to by @p |
| 182 | /// message. |
| 183 | bool |
| 184 | GetEventMessage(lldb::tid_t tid, unsigned long *message); |
| 185 | |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 186 | /// Resumes the given thread. If @p signo is anything but |
| 187 | /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 188 | bool |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 189 | Resume(lldb::tid_t tid, uint32_t signo); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 190 | |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 191 | /// Single steps the given thread. If @p signo is anything but |
| 192 | /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 193 | bool |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 194 | SingleStep(lldb::tid_t tid, uint32_t signo); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 195 | |
Ed Maste | 4e0999b | 2014-04-01 18:14:06 +0000 | [diff] [blame] | 196 | /// Terminate the traced process. |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 197 | bool |
Ed Maste | 4e0999b | 2014-04-01 18:14:06 +0000 | [diff] [blame] | 198 | Kill(); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 199 | |
Greg Clayton | 743ecf4 | 2012-10-16 20:20:18 +0000 | [diff] [blame] | 200 | lldb_private::Error |
Matt Kopec | 085d6ce | 2013-05-31 22:00:07 +0000 | [diff] [blame] | 201 | Detach(lldb::tid_t tid); |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 202 | |
Andrew Kaylor | bc68b43 | 2013-07-10 21:57:27 +0000 | [diff] [blame] | 203 | /// Stops the monitoring the child process thread. |
| 204 | void |
| 205 | StopMonitor(); |
| 206 | |
Andrew Kaylor | 93132f5 | 2013-05-28 23:04:25 +0000 | [diff] [blame] | 207 | /// Stops the requested thread and waits for the stop signal. |
| 208 | bool |
| 209 | StopThread(lldb::tid_t tid); |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 210 | |
Andrew Kaylor | d4d5499 | 2013-09-17 00:30:24 +0000 | [diff] [blame] | 211 | // Waits for the initial stop message from a new thread. |
| 212 | bool |
| 213 | WaitForInitialTIDStop(lldb::tid_t tid); |
| 214 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 215 | private: |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 216 | lldb_private::process_linux::ProcessLinux *m_process; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 217 | |
Zachary Turner | 39de311 | 2014-09-09 20:54:56 +0000 | [diff] [blame] | 218 | lldb_private::HostThread m_operation_thread; |
| 219 | lldb_private::HostThread m_monitor_thread; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 220 | lldb::pid_t m_pid; |
| 221 | int m_terminal_fd; |
| 222 | |
Daniel Malea | 1efb418 | 2013-09-16 23:12:18 +0000 | [diff] [blame] | 223 | // current operation which must be executed on the priviliged thread |
| 224 | Operation *m_operation; |
| 225 | lldb_private::Mutex m_operation_mutex; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 226 | |
Daniel Malea | 1efb418 | 2013-09-16 23:12:18 +0000 | [diff] [blame] | 227 | // semaphores notified when Operation is ready to be processed and when |
| 228 | // the operation is complete. |
| 229 | sem_t m_operation_pending; |
| 230 | sem_t m_operation_done; |
| 231 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 232 | |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 233 | struct OperationArgs |
| 234 | { |
| 235 | OperationArgs(ProcessMonitor *monitor); |
| 236 | |
| 237 | ~OperationArgs(); |
| 238 | |
| 239 | ProcessMonitor *m_monitor; // The monitor performing the attach. |
| 240 | sem_t m_semaphore; // Posted to once operation complete. |
| 241 | lldb_private::Error m_error; // Set if process operation failed. |
| 242 | }; |
| 243 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 244 | /// @class LauchArgs |
| 245 | /// |
| 246 | /// @brief Simple structure to pass data to the thread responsible for |
| 247 | /// launching a child process. |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 248 | struct LaunchArgs : OperationArgs |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 249 | { |
| 250 | LaunchArgs(ProcessMonitor *monitor, |
| 251 | lldb_private::Module *module, |
| 252 | char const **argv, |
| 253 | char const **envp, |
| 254 | const char *stdin_path, |
| 255 | const char *stdout_path, |
Daniel Malea | 6217d2a | 2013-01-08 14:49:22 +0000 | [diff] [blame] | 256 | const char *stderr_path, |
Todd Fiala | 0bce1b6 | 2014-08-17 00:10:50 +0000 | [diff] [blame] | 257 | const char *working_dir, |
| 258 | const lldb_private::ProcessLaunchInfo &launch_info); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 259 | |
| 260 | ~LaunchArgs(); |
| 261 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 262 | lldb_private::Module *m_module; // The executable image to launch. |
| 263 | char const **m_argv; // Process arguments. |
| 264 | char const **m_envp; // Process environment. |
| 265 | const char *m_stdin_path; // Redirect stdin or NULL. |
| 266 | const char *m_stdout_path; // Redirect stdout or NULL. |
| 267 | const char *m_stderr_path; // Redirect stderr or NULL. |
Daniel Malea | 6217d2a | 2013-01-08 14:49:22 +0000 | [diff] [blame] | 268 | const char *m_working_dir; // Working directory or NULL. |
Todd Fiala | 0bce1b6 | 2014-08-17 00:10:50 +0000 | [diff] [blame] | 269 | const lldb_private::ProcessLaunchInfo &m_launch_info; |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 270 | }; |
| 271 | |
| 272 | void |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 273 | StartLaunchOpThread(LaunchArgs *args, lldb_private::Error &error); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 274 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 275 | static void * |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 276 | LaunchOpThread(void *arg); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 277 | |
| 278 | static bool |
| 279 | Launch(LaunchArgs *args); |
| 280 | |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 281 | struct AttachArgs : OperationArgs |
| 282 | { |
| 283 | AttachArgs(ProcessMonitor *monitor, |
| 284 | lldb::pid_t pid); |
| 285 | |
| 286 | ~AttachArgs(); |
| 287 | |
| 288 | lldb::pid_t m_pid; // pid of the process to be attached. |
| 289 | }; |
| 290 | |
| 291 | void |
| 292 | StartAttachOpThread(AttachArgs *args, lldb_private::Error &error); |
| 293 | |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 294 | static void * |
| 295 | AttachOpThread(void *args); |
| 296 | |
| 297 | static bool |
| 298 | Attach(AttachArgs *args); |
| 299 | |
Matt Kopec | 085d6ce | 2013-05-31 22:00:07 +0000 | [diff] [blame] | 300 | static bool |
| 301 | SetDefaultPtraceOpts(const lldb::pid_t); |
| 302 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 303 | static void |
Johnny Chen | 25e68e3 | 2011-06-14 19:19:50 +0000 | [diff] [blame] | 304 | ServeOperation(OperationArgs *args); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 305 | |
| 306 | static bool |
| 307 | DupDescriptor(const char *path, int fd, int flags); |
| 308 | |
| 309 | static bool |
| 310 | MonitorCallback(void *callback_baton, |
Peter Collingbourne | 2c67b9a | 2011-11-21 00:10:19 +0000 | [diff] [blame] | 311 | lldb::pid_t pid, bool exited, int signal, int status); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 312 | |
| 313 | static ProcessMessage |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 314 | MonitorSIGTRAP(ProcessMonitor *monitor, |
Greg Clayton | 2804135 | 2011-11-29 20:50:10 +0000 | [diff] [blame] | 315 | const siginfo_t *info, lldb::pid_t pid); |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 316 | |
| 317 | static ProcessMessage |
| 318 | MonitorSignal(ProcessMonitor *monitor, |
Greg Clayton | 2804135 | 2011-11-29 20:50:10 +0000 | [diff] [blame] | 319 | const siginfo_t *info, lldb::pid_t pid); |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 320 | |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 321 | void |
| 322 | DoOperation(Operation *op); |
Stephen Wilson | 9212d7f | 2011-01-04 21:40:25 +0000 | [diff] [blame] | 323 | |
| 324 | /// Stops the child monitor thread. |
Stephen Wilson | 84ffe70 | 2011-03-30 15:55:52 +0000 | [diff] [blame] | 325 | void |
| 326 | StopMonitoringChildProcess(); |
| 327 | |
Greg Clayton | 743ecf4 | 2012-10-16 20:20:18 +0000 | [diff] [blame] | 328 | /// Stops the operation thread used to attach/launch a process. |
| 329 | void |
| 330 | StopOpThread(); |
Stephen Wilson | e6f9f66 | 2010-07-24 02:19:04 +0000 | [diff] [blame] | 331 | }; |
| 332 | |
| 333 | #endif // #ifndef liblldb_ProcessMonitor_H_ |