1af245d11STodd Fiala //===-- NativeProcessLinux.h ---------------------------------- -*- C++ -*-===//
2af245d11STodd Fiala //
3af245d11STodd Fiala //                     The LLVM Compiler Infrastructure
4af245d11STodd Fiala //
5af245d11STodd Fiala // This file is distributed under the University of Illinois Open Source
6af245d11STodd Fiala // License. See LICENSE.TXT for details.
7af245d11STodd Fiala //
8af245d11STodd Fiala //===----------------------------------------------------------------------===//
9af245d11STodd Fiala 
10af245d11STodd Fiala #ifndef liblldb_NativeProcessLinux_H_
11af245d11STodd Fiala #define liblldb_NativeProcessLinux_H_
12af245d11STodd Fiala 
13af245d11STodd Fiala // C Includes
14af245d11STodd Fiala #include <semaphore.h>
15af245d11STodd Fiala #include <signal.h>
16af245d11STodd Fiala 
17af245d11STodd Fiala // C++ Includes
18af245d11STodd Fiala #include <unordered_set>
19af245d11STodd Fiala 
20af245d11STodd Fiala // Other libraries and framework includes
21af245d11STodd Fiala #include "lldb/Core/ArchSpec.h"
22af245d11STodd Fiala #include "lldb/lldb-types.h"
23af245d11STodd Fiala #include "lldb/Host/Debug.h"
2439de3110SZachary Turner #include "lldb/Host/HostThread.h"
25af245d11STodd Fiala #include "lldb/Host/Mutex.h"
26af245d11STodd Fiala #include "lldb/Target/MemoryRegionInfo.h"
27af245d11STodd Fiala 
282fe1d0abSChaoren Lin #include "lldb/Host/common/NativeProcessProtocol.h"
29af245d11STodd Fiala 
30af245d11STodd Fiala namespace lldb_private
31af245d11STodd Fiala {
32af245d11STodd Fiala     class Error;
33af245d11STodd Fiala     class Module;
34fa03ad2eSChaoren Lin     class ThreadStateCoordinator;
35af245d11STodd Fiala     class Scalar;
36af245d11STodd Fiala 
37af245d11STodd Fiala     /// @class NativeProcessLinux
38af245d11STodd Fiala     /// @brief Manages communication with the inferior (debugee) process.
39af245d11STodd Fiala     ///
40af245d11STodd Fiala     /// Upon construction, this class prepares and launches an inferior process for
41af245d11STodd Fiala     /// debugging.
42af245d11STodd Fiala     ///
43af245d11STodd Fiala     /// Changes in the inferior process state are broadcasted.
44af245d11STodd Fiala     class NativeProcessLinux: public NativeProcessProtocol
45af245d11STodd Fiala     {
46af245d11STodd Fiala     public:
47af245d11STodd Fiala 
48af245d11STodd Fiala         static lldb_private::Error
49af245d11STodd Fiala         LaunchProcess (
50af245d11STodd Fiala             Module *exe_module,
51af245d11STodd Fiala             ProcessLaunchInfo &launch_info,
52af245d11STodd Fiala             lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
53af245d11STodd Fiala             NativeProcessProtocolSP &native_process_sp);
54af245d11STodd Fiala 
55af245d11STodd Fiala         static lldb_private::Error
56af245d11STodd Fiala         AttachToProcess (
57af245d11STodd Fiala             lldb::pid_t pid,
58af245d11STodd Fiala             lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
59af245d11STodd Fiala             NativeProcessProtocolSP &native_process_sp);
60af245d11STodd Fiala 
61af245d11STodd Fiala         // ---------------------------------------------------------------------
62af245d11STodd Fiala         // NativeProcessProtocol Interface
63af245d11STodd Fiala         // ---------------------------------------------------------------------
64af245d11STodd Fiala         Error
65af245d11STodd Fiala         Resume (const ResumeActionList &resume_actions) override;
66af245d11STodd Fiala 
67af245d11STodd Fiala         Error
68af245d11STodd Fiala         Halt () override;
69af245d11STodd Fiala 
70af245d11STodd Fiala         Error
71af245d11STodd Fiala         Detach () override;
72af245d11STodd Fiala 
73af245d11STodd Fiala         Error
74af245d11STodd Fiala         Signal (int signo) override;
75af245d11STodd Fiala 
76af245d11STodd Fiala         Error
77e9547b80SChaoren Lin         Interrupt () override;
78e9547b80SChaoren Lin 
79e9547b80SChaoren Lin         Error
80af245d11STodd Fiala         Kill () override;
81af245d11STodd Fiala 
82af245d11STodd Fiala         Error
83af245d11STodd Fiala         GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info) override;
84af245d11STodd Fiala 
85af245d11STodd Fiala         Error
86af245d11STodd Fiala         ReadMemory (lldb::addr_t addr, void *buf, lldb::addr_t size, lldb::addr_t &bytes_read) override;
87af245d11STodd Fiala 
88af245d11STodd Fiala         Error
89af245d11STodd Fiala         WriteMemory (lldb::addr_t addr, const void *buf, lldb::addr_t size, lldb::addr_t &bytes_written) override;
90af245d11STodd Fiala 
91af245d11STodd Fiala         Error
92af245d11STodd Fiala         AllocateMemory (lldb::addr_t size, uint32_t permissions, lldb::addr_t &addr) override;
93af245d11STodd Fiala 
94af245d11STodd Fiala         Error
95af245d11STodd Fiala         DeallocateMemory (lldb::addr_t addr) override;
96af245d11STodd Fiala 
97af245d11STodd Fiala         lldb::addr_t
98af245d11STodd Fiala         GetSharedLibraryInfoAddress () override;
99af245d11STodd Fiala 
100af245d11STodd Fiala         size_t
101af245d11STodd Fiala         UpdateThreads () override;
102af245d11STodd Fiala 
103af245d11STodd Fiala         bool
104af245d11STodd Fiala         GetArchitecture (ArchSpec &arch) const override;
105af245d11STodd Fiala 
106af245d11STodd Fiala         Error
107af245d11STodd Fiala         SetBreakpoint (lldb::addr_t addr, uint32_t size, bool hardware) override;
108af245d11STodd Fiala 
109af245d11STodd Fiala         void
110af245d11STodd Fiala         DoStopIDBumped (uint32_t newBumpId) override;
111af245d11STodd Fiala 
1128bc34f4dSOleksiy Vyalov         void
1138bc34f4dSOleksiy Vyalov         Terminate () override;
1148bc34f4dSOleksiy Vyalov 
115af245d11STodd Fiala         // ---------------------------------------------------------------------
116af245d11STodd Fiala         // Interface used by NativeRegisterContext-derived classes.
117af245d11STodd Fiala         // ---------------------------------------------------------------------
118af245d11STodd Fiala 
119af245d11STodd Fiala         /// Reads the contents from the register identified by the given (architecture
120af245d11STodd Fiala         /// dependent) offset.
121af245d11STodd Fiala         ///
122af245d11STodd Fiala         /// This method is provided for use by RegisterContextLinux derivatives.
12397ccc294SChaoren Lin         Error
124af245d11STodd Fiala         ReadRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name,
125af245d11STodd Fiala                           unsigned size, lldb_private::RegisterValue &value);
126af245d11STodd Fiala 
127af245d11STodd Fiala         /// Writes the given value to the register identified by the given
128af245d11STodd Fiala         /// (architecture dependent) offset.
129af245d11STodd Fiala         ///
130af245d11STodd Fiala         /// This method is provided for use by RegisterContextLinux derivatives.
13197ccc294SChaoren Lin         Error
132af245d11STodd Fiala         WriteRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name,
133af245d11STodd Fiala                            const lldb_private::RegisterValue &value);
134af245d11STodd Fiala 
135af245d11STodd Fiala         /// Reads all general purpose registers into the specified buffer.
13697ccc294SChaoren Lin         Error
137af245d11STodd Fiala         ReadGPR(lldb::tid_t tid, void *buf, size_t buf_size);
138af245d11STodd Fiala 
139af245d11STodd Fiala         /// Reads generic floating point registers into the specified buffer.
14097ccc294SChaoren Lin         Error
141af245d11STodd Fiala         ReadFPR(lldb::tid_t tid, void *buf, size_t buf_size);
142af245d11STodd Fiala 
143af245d11STodd Fiala         /// Reads the specified register set into the specified buffer.
144af245d11STodd Fiala         /// For instance, the extended floating-point register set.
14597ccc294SChaoren Lin         Error
146af245d11STodd Fiala         ReadRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset);
147af245d11STodd Fiala 
148af245d11STodd Fiala         /// Writes all general purpose registers into the specified buffer.
14997ccc294SChaoren Lin         Error
150af245d11STodd Fiala         WriteGPR(lldb::tid_t tid, void *buf, size_t buf_size);
151af245d11STodd Fiala 
152af245d11STodd Fiala         /// Writes generic floating point registers into the specified buffer.
15397ccc294SChaoren Lin         Error
154af245d11STodd Fiala         WriteFPR(lldb::tid_t tid, void *buf, size_t buf_size);
155af245d11STodd Fiala 
156af245d11STodd Fiala         /// Writes the specified register set into the specified buffer.
157af245d11STodd Fiala         /// For instance, the extended floating-point register set.
15897ccc294SChaoren Lin         Error
159af245d11STodd Fiala         WriteRegisterSet(lldb::tid_t tid, void *buf, size_t buf_size, unsigned int regset);
160af245d11STodd Fiala 
161*7cb18bf5STamas Berghammer         Error
162*7cb18bf5STamas Berghammer         GetLoadedModuleFileSpec(const char* module_path, FileSpec& file_spec) override;
163*7cb18bf5STamas Berghammer 
164af245d11STodd Fiala     protected:
165af245d11STodd Fiala         // ---------------------------------------------------------------------
166af245d11STodd Fiala         // NativeProcessProtocol protected interface
167af245d11STodd Fiala         // ---------------------------------------------------------------------
168af245d11STodd Fiala         Error
169af245d11STodd Fiala         GetSoftwareBreakpointTrapOpcode (size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) override;
170af245d11STodd Fiala 
171af245d11STodd Fiala     private:
172af245d11STodd Fiala 
173af245d11STodd Fiala         lldb_private::ArchSpec m_arch;
174af245d11STodd Fiala 
17539de3110SZachary Turner         HostThread m_operation_thread;
17639de3110SZachary Turner         HostThread m_monitor_thread;
177af245d11STodd Fiala 
178af245d11STodd Fiala         // current operation which must be executed on the priviliged thread
179af245d11STodd Fiala         void *m_operation;
180af245d11STodd Fiala         lldb_private::Mutex m_operation_mutex;
181af245d11STodd Fiala 
182af245d11STodd Fiala         // semaphores notified when Operation is ready to be processed and when
183af245d11STodd Fiala         // the operation is complete.
184af245d11STodd Fiala         sem_t m_operation_pending;
185af245d11STodd Fiala         sem_t m_operation_done;
186af245d11STodd Fiala 
187af245d11STodd Fiala         lldb_private::LazyBool m_supports_mem_region;
188af245d11STodd Fiala         std::vector<MemoryRegionInfo> m_mem_region_cache;
189af245d11STodd Fiala         lldb_private::Mutex m_mem_region_cache_mutex;
190af245d11STodd Fiala 
191fa03ad2eSChaoren Lin         std::unique_ptr<ThreadStateCoordinator> m_coordinator_up;
192fa03ad2eSChaoren Lin         HostThread m_coordinator_thread;
193af245d11STodd Fiala 
194af245d11STodd Fiala         struct OperationArgs
195af245d11STodd Fiala         {
196af245d11STodd Fiala             OperationArgs(NativeProcessLinux *monitor);
197af245d11STodd Fiala 
198af245d11STodd Fiala             ~OperationArgs();
199af245d11STodd Fiala 
200af245d11STodd Fiala             NativeProcessLinux *m_monitor;      // The monitor performing the attach.
201af245d11STodd Fiala             sem_t m_semaphore;              // Posted to once operation complete.
202af245d11STodd Fiala             lldb_private::Error m_error;    // Set if process operation failed.
203af245d11STodd Fiala         };
204af245d11STodd Fiala 
205af245d11STodd Fiala         /// @class LauchArgs
206af245d11STodd Fiala         ///
207af245d11STodd Fiala         /// @brief Simple structure to pass data to the thread responsible for
208af245d11STodd Fiala         /// launching a child process.
209af245d11STodd Fiala         struct LaunchArgs : OperationArgs
210af245d11STodd Fiala         {
211af245d11STodd Fiala             LaunchArgs(NativeProcessLinux *monitor,
212af245d11STodd Fiala                     lldb_private::Module *module,
213af245d11STodd Fiala                     char const **argv,
214af245d11STodd Fiala                     char const **envp,
21575f47c3aSTodd Fiala                     const std::string &stdin_path,
21675f47c3aSTodd Fiala                     const std::string &stdout_path,
21775f47c3aSTodd Fiala                     const std::string &stderr_path,
2180bce1b67STodd Fiala                     const char *working_dir,
2190bce1b67STodd Fiala                     const lldb_private::ProcessLaunchInfo &launch_info);
220af245d11STodd Fiala 
221af245d11STodd Fiala             ~LaunchArgs();
222af245d11STodd Fiala 
223af245d11STodd Fiala             lldb_private::Module *m_module; // The executable image to launch.
224af245d11STodd Fiala             char const **m_argv;            // Process arguments.
225af245d11STodd Fiala             char const **m_envp;            // Process environment.
22675f47c3aSTodd Fiala             const std::string &m_stdin_path;  // Redirect stdin if not empty.
22775f47c3aSTodd Fiala             const std::string &m_stdout_path; // Redirect stdout if not empty.
22875f47c3aSTodd Fiala             const std::string &m_stderr_path; // Redirect stderr if not empty.
229af245d11STodd Fiala             const char *m_working_dir;      // Working directory or NULL.
2300bce1b67STodd Fiala             const lldb_private::ProcessLaunchInfo &m_launch_info;
231af245d11STodd Fiala         };
232af245d11STodd Fiala 
233af245d11STodd Fiala         struct AttachArgs : OperationArgs
234af245d11STodd Fiala         {
235af245d11STodd Fiala             AttachArgs(NativeProcessLinux *monitor,
236af245d11STodd Fiala                        lldb::pid_t pid);
237af245d11STodd Fiala 
238af245d11STodd Fiala             ~AttachArgs();
239af245d11STodd Fiala 
240af245d11STodd Fiala             lldb::pid_t m_pid;              // pid of the process to be attached.
241af245d11STodd Fiala         };
242af245d11STodd Fiala 
243af245d11STodd Fiala         // ---------------------------------------------------------------------
244af245d11STodd Fiala         // Private Instance Methods
245af245d11STodd Fiala         // ---------------------------------------------------------------------
246af245d11STodd Fiala         NativeProcessLinux ();
247af245d11STodd Fiala 
248af245d11STodd Fiala         /// Launches an inferior process ready for debugging.  Forms the
249af245d11STodd Fiala         /// implementation of Process::DoLaunch.
250af245d11STodd Fiala         void
251af245d11STodd Fiala         LaunchInferior (
252af245d11STodd Fiala             Module *module,
253af245d11STodd Fiala             char const *argv[],
254af245d11STodd Fiala             char const *envp[],
25575f47c3aSTodd Fiala             const std::string &stdin_path,
25675f47c3aSTodd Fiala             const std::string &stdout_path,
25775f47c3aSTodd Fiala             const std::string &stderr_path,
258af245d11STodd Fiala             const char *working_dir,
2590bce1b67STodd Fiala             const lldb_private::ProcessLaunchInfo &launch_info,
260af245d11STodd Fiala             Error &error);
261af245d11STodd Fiala 
262af245d11STodd Fiala         /// Attaches to an existing process.  Forms the
2630cbf0b13STamas Berghammer         /// implementation of Process::DoAttach
264af245d11STodd Fiala         void
265af245d11STodd Fiala         AttachToInferior (lldb::pid_t pid, Error &error);
266af245d11STodd Fiala 
267af245d11STodd Fiala         void
268af245d11STodd Fiala         StartLaunchOpThread(LaunchArgs *args, lldb_private::Error &error);
269af245d11STodd Fiala 
270af245d11STodd Fiala         static void *
271af245d11STodd Fiala         LaunchOpThread(void *arg);
272af245d11STodd Fiala 
273af245d11STodd Fiala         static bool
274af245d11STodd Fiala         Launch(LaunchArgs *args);
275af245d11STodd Fiala 
276af245d11STodd Fiala         void
277af245d11STodd Fiala         StartAttachOpThread(AttachArgs *args, lldb_private::Error &error);
278af245d11STodd Fiala 
279af245d11STodd Fiala         static void *
280af245d11STodd Fiala         AttachOpThread(void *args);
281af245d11STodd Fiala 
282af245d11STodd Fiala         static bool
283af245d11STodd Fiala         Attach(AttachArgs *args);
284af245d11STodd Fiala 
28597ccc294SChaoren Lin         static Error
286af245d11STodd Fiala         SetDefaultPtraceOpts(const lldb::pid_t);
287af245d11STodd Fiala 
288af245d11STodd Fiala         static void
289af245d11STodd Fiala         ServeOperation(OperationArgs *args);
290af245d11STodd Fiala 
291af245d11STodd Fiala         static bool
292af245d11STodd Fiala         DupDescriptor(const char *path, int fd, int flags);
293af245d11STodd Fiala 
294af245d11STodd Fiala         static bool
295af245d11STodd Fiala         MonitorCallback(void *callback_baton,
296af245d11STodd Fiala                 lldb::pid_t pid, bool exited, int signal, int status);
297af245d11STodd Fiala 
298af245d11STodd Fiala         void
299af245d11STodd Fiala         MonitorSIGTRAP(const siginfo_t *info, lldb::pid_t pid);
300af245d11STodd Fiala 
301af245d11STodd Fiala         void
302c16f5dcaSChaoren Lin         MonitorTrace(lldb::pid_t pid, NativeThreadProtocolSP thread_sp);
303c16f5dcaSChaoren Lin 
304c16f5dcaSChaoren Lin         void
305c16f5dcaSChaoren Lin         MonitorBreakpoint(lldb::pid_t pid, NativeThreadProtocolSP thread_sp);
306c16f5dcaSChaoren Lin 
307c16f5dcaSChaoren Lin         void
308c16f5dcaSChaoren Lin         MonitorWatchpoint(lldb::pid_t pid, NativeThreadProtocolSP thread_sp, uint32_t wp_index);
309c16f5dcaSChaoren Lin 
310c16f5dcaSChaoren Lin         void
311af245d11STodd Fiala         MonitorSignal(const siginfo_t *info, lldb::pid_t pid, bool exited);
312af245d11STodd Fiala 
313af245d11STodd Fiala #if 0
314af245d11STodd Fiala         static ::ProcessMessage::CrashReason
315af245d11STodd Fiala         GetCrashReasonForSIGSEGV(const siginfo_t *info);
316af245d11STodd Fiala 
317af245d11STodd Fiala         static ::ProcessMessage::CrashReason
318af245d11STodd Fiala         GetCrashReasonForSIGILL(const siginfo_t *info);
319af245d11STodd Fiala 
320af245d11STodd Fiala         static ::ProcessMessage::CrashReason
321af245d11STodd Fiala         GetCrashReasonForSIGFPE(const siginfo_t *info);
322af245d11STodd Fiala 
323af245d11STodd Fiala         static ::ProcessMessage::CrashReason
324af245d11STodd Fiala         GetCrashReasonForSIGBUS(const siginfo_t *info);
325af245d11STodd Fiala #endif
326af245d11STodd Fiala 
327af245d11STodd Fiala         void
328af245d11STodd Fiala         DoOperation(void *op);
329af245d11STodd Fiala 
330af245d11STodd Fiala         /// Stops the child monitor thread.
331af245d11STodd Fiala         void
3320cbf0b13STamas Berghammer         StopMonitorThread();
333af245d11STodd Fiala 
334af245d11STodd Fiala         /// Stops the operation thread used to attach/launch a process.
335af245d11STodd Fiala         void
336af245d11STodd Fiala         StopOpThread();
337af245d11STodd Fiala 
338fa03ad2eSChaoren Lin         Error
339fa03ad2eSChaoren Lin         StartCoordinatorThread ();
340fa03ad2eSChaoren Lin 
341fa03ad2eSChaoren Lin         static void*
342fa03ad2eSChaoren Lin         CoordinatorThread (void *arg);
343fa03ad2eSChaoren Lin 
344fa03ad2eSChaoren Lin         void
345fa03ad2eSChaoren Lin         StopCoordinatorThread ();
346fa03ad2eSChaoren Lin 
347af245d11STodd Fiala         /// Stops monitoring the child process thread.
348af245d11STodd Fiala         void
349af245d11STodd Fiala         StopMonitor();
350af245d11STodd Fiala 
351af245d11STodd Fiala         bool
352af245d11STodd Fiala         HasThreadNoLock (lldb::tid_t thread_id);
353af245d11STodd Fiala 
354af245d11STodd Fiala         NativeThreadProtocolSP
355af245d11STodd Fiala         MaybeGetThreadNoLock (lldb::tid_t thread_id);
356af245d11STodd Fiala 
357af245d11STodd Fiala         bool
358af245d11STodd Fiala         StopTrackingThread (lldb::tid_t thread_id);
359af245d11STodd Fiala 
360af245d11STodd Fiala         NativeThreadProtocolSP
361af245d11STodd Fiala         AddThread (lldb::tid_t thread_id);
362af245d11STodd Fiala 
363af245d11STodd Fiala         NativeThreadProtocolSP
364af245d11STodd Fiala         GetOrCreateThread (lldb::tid_t thread_id, bool &created);
365af245d11STodd Fiala 
366af245d11STodd Fiala         Error
367af245d11STodd Fiala         GetSoftwareBreakpointSize (NativeRegisterContextSP context_sp, uint32_t &actual_opcode_size);
368af245d11STodd Fiala 
369af245d11STodd Fiala         Error
370af245d11STodd Fiala         FixupBreakpointPCAsNeeded (NativeThreadProtocolSP &thread_sp);
371af245d11STodd Fiala 
372af245d11STodd Fiala         /// Writes a siginfo_t structure corresponding to the given thread ID to the
373af245d11STodd Fiala         /// memory region pointed to by @p siginfo.
37497ccc294SChaoren Lin         Error
37597ccc294SChaoren Lin         GetSignalInfo(lldb::tid_t tid, void *siginfo);
376af245d11STodd Fiala 
377af245d11STodd Fiala         /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG)
378af245d11STodd Fiala         /// corresponding to the given thread ID to the memory pointed to by @p
379af245d11STodd Fiala         /// message.
38097ccc294SChaoren Lin         Error
381af245d11STodd Fiala         GetEventMessage(lldb::tid_t tid, unsigned long *message);
382af245d11STodd Fiala 
383af245d11STodd Fiala         /// Resumes the given thread.  If @p signo is anything but
384af245d11STodd Fiala         /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
38597ccc294SChaoren Lin         Error
386af245d11STodd Fiala         Resume(lldb::tid_t tid, uint32_t signo);
387af245d11STodd Fiala 
388af245d11STodd Fiala         /// Single steps the given thread.  If @p signo is anything but
389af245d11STodd Fiala         /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
39097ccc294SChaoren Lin         Error
391af245d11STodd Fiala         SingleStep(lldb::tid_t tid, uint32_t signo);
392af245d11STodd Fiala 
393fa03ad2eSChaoren Lin         // ThreadStateCoordinator helper methods.
394511e5cdcSTodd Fiala         void
395fa03ad2eSChaoren Lin         NotifyThreadCreateStopped (lldb::tid_t tid);
396511e5cdcSTodd Fiala 
397511e5cdcSTodd Fiala         void
398fa03ad2eSChaoren Lin         NotifyThreadCreateRunning (lldb::tid_t tid);
399fa03ad2eSChaoren Lin 
400fa03ad2eSChaoren Lin         void
401fa03ad2eSChaoren Lin         NotifyThreadDeath (lldb::tid_t tid);
402fa03ad2eSChaoren Lin 
403fa03ad2eSChaoren Lin         void
404fa03ad2eSChaoren Lin         NotifyThreadStop (lldb::tid_t tid);
405fa03ad2eSChaoren Lin 
406fa03ad2eSChaoren Lin         void
407fa03ad2eSChaoren Lin         CallAfterRunningThreadsStop (lldb::tid_t tid,
408fa03ad2eSChaoren Lin                                      const std::function<void (lldb::tid_t tid)> &call_after_function);
409511e5cdcSTodd Fiala 
41003f12d6bSChaoren Lin         void
41103f12d6bSChaoren Lin         CallAfterRunningThreadsStopWithSkipTID (lldb::tid_t deferred_signal_tid,
41203f12d6bSChaoren Lin                                                 lldb::tid_t skip_stop_request_tid,
41303f12d6bSChaoren Lin                                                 const std::function<void (lldb::tid_t tid)> &call_after_function);
41403f12d6bSChaoren Lin 
415af245d11STodd Fiala         lldb_private::Error
416af245d11STodd Fiala         Detach(lldb::tid_t tid);
41786fd8e45SChaoren Lin 
41886fd8e45SChaoren Lin         lldb_private::Error
41986fd8e45SChaoren Lin         RequestThreadStop (const lldb::pid_t pid, const lldb::tid_t tid);
420af245d11STodd Fiala     };
421af245d11STodd Fiala } // End lldb_private namespace.
422af245d11STodd Fiala 
423af245d11STodd Fiala #endif // #ifndef liblldb_NativeProcessLinux_H_
424