blob: 5cde354ff3c5d9ff55110a68ac32b779c8c9b42d [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:24 +00001//===-- ProcessGDBRemote.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_ProcessGDBRemote_h_
11#define liblldb_ProcessGDBRemote_h_
12
13// C Includes
14
15// C++ Includes
16#include <list>
Greg Clayton71fc2a32011-02-12 06:28:37 +000017#include <vector>
Chris Lattner30fdc8d2010-06-08 16:52:24 +000018
19// Other libraries and framework includes
20#include "lldb/Core/ArchSpec.h"
21#include "lldb/Core/Broadcaster.h"
Jason Molenda2e56a252013-05-11 03:09:05 +000022#include "lldb/Core/ConstString.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000023#include "lldb/Core/Error.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000024#include "lldb/Core/StreamString.h"
Jim Ingham5aee1622010-08-09 23:31:02 +000025#include "lldb/Core/StringList.h"
Jason Molenda705b1802014-06-13 02:37:02 +000026#include "lldb/Core/StructuredData.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000027#include "lldb/Core/ThreadSafeValue.h"
Zachary Turner39de3112014-09-09 20:54:56 +000028#include "lldb/Host/HostThread.h"
Todd Fiala4ceced32014-08-29 17:35:57 +000029#include "lldb/lldb-private-forward.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000030#include "lldb/Target/Process.h"
31#include "lldb/Target/Thread.h"
32
Greg Clayton576d8832011-03-22 04:00:09 +000033#include "GDBRemoteCommunicationClient.h"
Greg Claytonc982c762010-07-09 20:39:50 +000034#include "Utility/StringExtractor.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000035#include "GDBRemoteRegisterContext.h"
Chris Lattner30fdc8d2010-06-08 16:52:24 +000036
Tamas Berghammerdb264a62015-03-31 09:52:22 +000037namespace lldb_private {
38namespace process_gdb_remote {
39
Chris Lattner30fdc8d2010-06-08 16:52:24 +000040class ThreadGDBRemote;
41
Tamas Berghammerdb264a62015-03-31 09:52:22 +000042class ProcessGDBRemote : public Process
Chris Lattner30fdc8d2010-06-08 16:52:24 +000043{
44public:
45 //------------------------------------------------------------------
46 // Constructors and Destructors
47 //------------------------------------------------------------------
Greg Claytonc3776bf2012-02-09 06:16:32 +000048 static lldb::ProcessSP
Tamas Berghammerdb264a62015-03-31 09:52:22 +000049 CreateInstance (Target& target,
50 Listener &listener,
51 const FileSpec *crash_file_path);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000052
53 static void
54 Initialize();
55
56 static void
Tamas Berghammerdb264a62015-03-31 09:52:22 +000057 DebuggerInitialize (Debugger &debugger);
Greg Clayton7f982402013-07-15 22:54:20 +000058
59 static void
Chris Lattner30fdc8d2010-06-08 16:52:24 +000060 Terminate();
61
Tamas Berghammerdb264a62015-03-31 09:52:22 +000062 static ConstString
Chris Lattner30fdc8d2010-06-08 16:52:24 +000063 GetPluginNameStatic();
64
65 static const char *
66 GetPluginDescriptionStatic();
67
68 //------------------------------------------------------------------
69 // Constructors and Destructors
70 //------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +000071 ProcessGDBRemote(Target& target, Listener &listener);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000072
73 virtual
74 ~ProcessGDBRemote();
75
76 //------------------------------------------------------------------
77 // Check if a given Process
78 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000079 bool
Tamas Berghammerdb264a62015-03-31 09:52:22 +000080 CanDebug (Target &target, bool plugin_specified_by_name) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000081
Tamas Berghammerdb264a62015-03-31 09:52:22 +000082 CommandObject *
Eric Christopher7ab81b92014-11-04 03:13:17 +000083 GetPluginCommandObject() override;
Jim Ingham5aee1622010-08-09 23:31:02 +000084
Chris Lattner30fdc8d2010-06-08 16:52:24 +000085 //------------------------------------------------------------------
86 // Creating a new process, or attaching to an existing one
87 //------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +000088 Error
89 WillLaunch (Module* module) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000090
Tamas Berghammerdb264a62015-03-31 09:52:22 +000091 Error
92 DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000093
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000094 void
Eric Christopher7ab81b92014-11-04 03:13:17 +000095 DidLaunch () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000096
Tamas Berghammerdb264a62015-03-31 09:52:22 +000097 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +000098 WillAttachToProcessWithID (lldb::pid_t pid) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000099
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000100 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000101 WillAttachToProcessWithName (const char *process_name, bool wait_for_launch) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000102
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000103 Error
104 DoConnectRemote (Stream *strm, const char *remote_url) override;
Greg Claytonb766a732011-02-04 01:58:07 +0000105
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000106 Error
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000107 WillLaunchOrAttach ();
108
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000109 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000110 DoAttachToProcessWithID (lldb::pid_t pid) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000111
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000112 Error
113 DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info) override;
Han Ming Ong84647042012-02-25 01:07:38 +0000114
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000115 Error
Han Ming Ong84647042012-02-25 01:07:38 +0000116 DoAttachToProcessWithName (const char *process_name,
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000117 const ProcessAttachInfo &attach_info) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000118
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000119 void
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000120 DidAttach (ArchSpec &process_arch) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000121
122 //------------------------------------------------------------------
123 // PluginInterface protocol
124 //------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000125 ConstString
Eric Christopher7ab81b92014-11-04 03:13:17 +0000126 GetPluginName() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000127
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000128 uint32_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000129 GetPluginVersion() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000130
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000131 //------------------------------------------------------------------
132 // Process Control
133 //------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000134 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000135 WillResume () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000136
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000137 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000138 DoResume () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000139
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000140 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000141 DoHalt (bool &caused_stop) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000142
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000143 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000144 DoDetach (bool keep_stopped) override;
Jim Ingham8af3b9c2013-03-29 01:18:12 +0000145
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000146 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000147 DetachRequiresHalt() override { return true; }
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000148
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000149 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000150 DoSignal (int signal) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000151
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000152 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000153 DoDestroy () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000154
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000155 void
Eric Christopher7ab81b92014-11-04 03:13:17 +0000156 RefreshStateAfterStop() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000157
158 //------------------------------------------------------------------
159 // Process Queries
160 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000161 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000162 IsAlive () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000163
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000164 lldb::addr_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000165 GetImageInfoAddress() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000166
167 //------------------------------------------------------------------
168 // Process Memory
169 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000170 size_t
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000171 DoReadMemory (lldb::addr_t addr, void *buf, size_t size, Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000172
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000173 size_t
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000174 DoWriteMemory (lldb::addr_t addr, const void *buf, size_t size, Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000175
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000176 lldb::addr_t
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000177 DoAllocateMemory (size_t size, uint32_t permissions, Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000178
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000179 Error
180 GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &region_info) override;
Greg Clayton46fb5582011-11-18 07:03:08 +0000181
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000182 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000183 DoDeallocateMemory (lldb::addr_t ptr) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000184
185 //------------------------------------------------------------------
186 // Process STDIO
187 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000188 size_t
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000189 PutSTDIN (const char *buf, size_t buf_size, Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000190
191 //----------------------------------------------------------------------
192 // Process Breakpoints
193 //----------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000194 Error
195 EnableBreakpointSite (BreakpointSite *bp_site) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000196
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000197 Error
198 DisableBreakpointSite (BreakpointSite *bp_site) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000199
200 //----------------------------------------------------------------------
201 // Process Watchpoints
202 //----------------------------------------------------------------------
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000203 Error
204 EnableWatchpoint (Watchpoint *wp, bool notify = true) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000205
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000206 Error
207 DisableWatchpoint (Watchpoint *wp, bool notify = true) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000208
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000209 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000210 GetWatchpointSupportInfo (uint32_t &num) override;
Johnny Chen64637202012-05-23 21:09:52 +0000211
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000212 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000213 GetWatchpointSupportInfo (uint32_t &num, bool& after) override;
Enrico Granataf04a2192012-07-13 23:18:48 +0000214
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000215 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000216 StartNoticingNewThreads() override;
Jim Ingham1c823b42011-01-22 01:33:44 +0000217
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000218 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000219 StopNoticingNewThreads() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000220
Greg Claytonc1422c12012-04-09 22:46:21 +0000221 GDBRemoteCommunicationClient &
222 GetGDBRemote()
223 {
224 return m_gdb_comm;
225 }
Greg Claytonfbb76342013-11-20 21:07:01 +0000226
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000227 Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000228 SendEventData(const char *data) override;
Jason Molendaa3329782014-03-29 18:54:20 +0000229
Greg Claytonfbb76342013-11-20 21:07:01 +0000230 //----------------------------------------------------------------------
231 // Override SetExitStatus so we can disconnect from the remote GDB server
232 //----------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000233 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000234 SetExitStatus (int exit_status, const char *cstr) override;
Greg Claytonfbb76342013-11-20 21:07:01 +0000235
Jason Molenda6076bf42014-05-06 04:34:52 +0000236 void
237 SetUserSpecifiedMaxMemoryTransferSize (uint64_t user_specified_max);
238
Tamas Berghammer7cb18bf2015-03-24 11:15:23 +0000239 bool
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000240 GetModuleSpec(const FileSpec& module_file_spec,
241 const ArchSpec& arch,
242 ModuleSpec &module_spec) override;
Tamas Berghammer7cb18bf2015-03-24 11:15:23 +0000243
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000244protected:
245 friend class ThreadGDBRemote;
Greg Clayton576d8832011-03-22 04:00:09 +0000246 friend class GDBRemoteCommunicationClient;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000247 friend class GDBRemoteRegisterContext;
248
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000249 //----------------------------------------------------------------------
250 // Accessors
251 //----------------------------------------------------------------------
252 bool
253 IsRunning ( lldb::StateType state )
254 {
255 return state == lldb::eStateRunning || IsStepping(state);
256 }
257
258 bool
259 IsStepping ( lldb::StateType state)
260 {
261 return state == lldb::eStateStepping;
262 }
263 bool
264 CanResume ( lldb::StateType state)
265 {
266 return state == lldb::eStateStopped;
267 }
268
269 bool
270 HasExited (lldb::StateType state)
271 {
272 return state == lldb::eStateExited;
273 }
274
275 bool
276 ProcessIDIsValid ( ) const;
277
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000278 void
279 Clear ( );
280
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000281 Flags &
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000282 GetFlags ()
283 {
284 return m_flags;
285 }
286
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000287 const Flags &
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000288 GetFlags () const
289 {
290 return m_flags;
291 }
292
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000293 bool
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000294 UpdateThreadList (ThreadList &old_thread_list,
295 ThreadList &new_thread_list) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000296
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000297 Error
298 LaunchAndConnectToDebugserver (const ProcessInfo &process_info);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000299
300 void
301 KillDebugserverProcess ();
302
303 void
Greg Clayton513c26c2011-01-29 07:10:55 +0000304 BuildDynamicRegisterInfo (bool force);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000305
Greg Clayton09c3e3d2011-12-06 04:51:14 +0000306 void
Greg Clayton8cda7f02013-05-21 21:55:59 +0000307 SetLastStopPacket (const StringExtractorGDBRemote &response);
Jason Molendad1fae142012-09-29 08:03:33 +0000308
Greg Claytonef8180a2013-10-15 00:14:28 +0000309 bool
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000310 ParsePythonTargetDefinition(const FileSpec &target_definition_fspec);
Greg Claytonef8180a2013-10-15 00:14:28 +0000311
Todd Fialaaf245d12014-06-30 21:05:18 +0000312 const lldb::DataBufferSP
313 GetAuxvData() override;
Steve Pucci03904ac2014-03-04 23:18:46 +0000314
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000315 StructuredData::ObjectSP
Jason Molenda705b1802014-06-13 02:37:02 +0000316 GetExtendedInfoForThread (lldb::tid_t tid);
317
Jason Molenda6076bf42014-05-06 04:34:52 +0000318 void
319 GetMaxMemorySize();
320
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000321 //------------------------------------------------------------------
322 /// Broadcaster event bits definitions.
323 //------------------------------------------------------------------
324 enum
325 {
326 eBroadcastBitAsyncContinue = (1 << 0),
Jim Inghamb1e2e842012-04-12 18:49:31 +0000327 eBroadcastBitAsyncThreadShouldExit = (1 << 1),
328 eBroadcastBitAsyncThreadDidExit = (1 << 2)
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000329 };
Jim Ingham455fa5c2012-11-01 01:15:33 +0000330
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000331 Flags m_flags; // Process specific flags (see eFlags enums)
Greg Clayton576d8832011-03-22 04:00:09 +0000332 GDBRemoteCommunicationClient m_gdb_comm;
Todd Fiala7b0917a2014-09-15 20:07:33 +0000333 std::atomic<lldb::pid_t> m_debugserver_pid;
Greg Claytondd0e5a52011-06-02 22:22:38 +0000334 StringExtractorGDBRemote m_last_stop_packet;
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000335 Mutex m_last_stop_packet_mutex;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000336 GDBRemoteDynamicRegisterInfo m_register_info;
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000337 Broadcaster m_async_broadcaster;
338 HostThread m_async_thread;
339 Mutex m_async_thread_state_mutex;
Greg Clayton71fc2a32011-02-12 06:28:37 +0000340 typedef std::vector<lldb::tid_t> tid_collection;
341 typedef std::vector< std::pair<lldb::tid_t,int> > tid_sig_collection;
Greg Clayton70b57652011-05-15 01:25:55 +0000342 typedef std::map<lldb::addr_t, lldb::addr_t> MMapMap;
Greg Clayton9e920902012-04-10 02:25:43 +0000343 tid_collection m_thread_ids; // Thread IDs for all threads. This list gets updated after stopping
Greg Clayton71fc2a32011-02-12 06:28:37 +0000344 tid_collection m_continue_c_tids; // 'c' for continue
345 tid_sig_collection m_continue_C_tids; // 'C' for continue with signal
346 tid_collection m_continue_s_tids; // 's' for step
347 tid_sig_collection m_continue_S_tids; // 'S' for step with signal
Jason Molenda6076bf42014-05-06 04:34:52 +0000348 uint64_t m_max_memory_size; // The maximum number of bytes to read/write when reading and writing memory
349 uint64_t m_remote_stub_max_memory_size; // The maximum memory size the remote gdb stub can handle
Greg Clayton70b57652011-05-15 01:25:55 +0000350 MMapMap m_addr_to_mmap_size;
Greg Clayton4116e932012-05-15 02:33:01 +0000351 lldb::BreakpointSP m_thread_create_bp_sp;
352 bool m_waiting_for_attach;
Jim Ingham43c555d2012-07-04 00:35:43 +0000353 bool m_destroy_tried_resuming;
Greg Clayton998255b2012-10-13 02:07:45 +0000354 lldb::CommandObjectSP m_command_sp;
Hafiz Abid Qadeer85a4daf2013-10-18 10:04:33 +0000355 int64_t m_breakpoint_pc_offset;
Todd Fialaaf245d12014-06-30 21:05:18 +0000356
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000357 bool
358 StartAsyncThread ();
359
360 void
361 StopAsyncThread ();
362
Virgile Bellob2f1fb22013-08-23 12:44:05 +0000363 static lldb::thread_result_t
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000364 AsyncThread (void *arg);
365
366 static bool
367 MonitorDebugserverProcess (void *callback_baton,
368 lldb::pid_t pid,
Greg Claytone4e45922011-11-16 05:37:56 +0000369 bool exited,
370 int signo,
371 int exit_status);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000372
373 lldb::StateType
374 SetThreadStopInfo (StringExtractor& stop_packet);
375
376 void
Greg Clayton9e920902012-04-10 02:25:43 +0000377 ClearThreadIDList ();
378
379 bool
380 UpdateThreadIDList ();
381
382 void
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000383 DidLaunchOrAttach (ArchSpec& process_arch);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000384
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000385 Error
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000386 ConnectToDebugserver (const char *host_port);
387
388 const char *
389 GetDispatchQueueNameForThread (lldb::addr_t thread_dispatch_qaddr,
390 std::string &dispatch_queue_name);
391
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000392 DynamicLoader *
Eric Christopher7ab81b92014-11-04 03:13:17 +0000393 GetDynamicLoader () override;
Jason Molenda5e8534e2012-10-03 01:29:34 +0000394
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000395private:
396 //------------------------------------------------------------------
397 // For ProcessGDBRemote only
398 //------------------------------------------------------------------
Jim Ingham1c823b42011-01-22 01:33:44 +0000399 static bool
400 NewThreadNotifyBreakpointHit (void *baton,
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000401 StoppointCallbackContext *context,
Jim Ingham1c823b42011-01-22 01:33:44 +0000402 lldb::user_id_t break_id,
403 lldb::user_id_t break_loc_id);
404
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000405 DISALLOW_COPY_AND_ASSIGN (ProcessGDBRemote);
406
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000407};
408
Tamas Berghammerdb264a62015-03-31 09:52:22 +0000409} // namespace process_gdb_remote
410} // namespace lldb_private
411
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000412#endif // liblldb_ProcessGDBRemote_h_