blob: 8cd445e8792b5dc9383d10dce1b348e9361e2159 [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
37class ThreadGDBRemote;
38
39class ProcessGDBRemote : public lldb_private::Process
40{
41public:
42 //------------------------------------------------------------------
43 // Constructors and Destructors
44 //------------------------------------------------------------------
Greg Claytonc3776bf2012-02-09 06:16:32 +000045 static lldb::ProcessSP
46 CreateInstance (lldb_private::Target& target,
47 lldb_private::Listener &listener,
48 const lldb_private::FileSpec *crash_file_path);
Chris Lattner30fdc8d2010-06-08 16:52:24 +000049
50 static void
51 Initialize();
52
53 static void
Greg Clayton7f982402013-07-15 22:54:20 +000054 DebuggerInitialize (lldb_private::Debugger &debugger);
55
56 static void
Chris Lattner30fdc8d2010-06-08 16:52:24 +000057 Terminate();
58
Greg Clayton57abc5d2013-05-10 21:47:16 +000059 static lldb_private::ConstString
Chris Lattner30fdc8d2010-06-08 16:52:24 +000060 GetPluginNameStatic();
61
62 static const char *
63 GetPluginDescriptionStatic();
64
65 //------------------------------------------------------------------
66 // Constructors and Destructors
67 //------------------------------------------------------------------
68 ProcessGDBRemote(lldb_private::Target& target, lldb_private::Listener &listener);
69
70 virtual
71 ~ProcessGDBRemote();
72
73 //------------------------------------------------------------------
74 // Check if a given Process
75 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000076 bool
Greg Clayton3a29bdb2011-07-17 20:36:25 +000077 CanDebug (lldb_private::Target &target,
Eric Christopher7ab81b92014-11-04 03:13:17 +000078 bool plugin_specified_by_name) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000079
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000080 lldb_private::CommandObject *
Eric Christopher7ab81b92014-11-04 03:13:17 +000081 GetPluginCommandObject() override;
Jim Ingham5aee1622010-08-09 23:31:02 +000082
Chris Lattner30fdc8d2010-06-08 16:52:24 +000083 //------------------------------------------------------------------
84 // Creating a new process, or attaching to an existing one
85 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000086 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +000087 WillLaunch (lldb_private::Module* module) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000088
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000089 lldb_private::Error
Greg Clayton982c9762011-11-03 21:22:33 +000090 DoLaunch (lldb_private::Module *exe_module,
Eric Christopher7ab81b92014-11-04 03:13:17 +000091 lldb_private::ProcessLaunchInfo &launch_info) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000092
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000093 void
Eric Christopher7ab81b92014-11-04 03:13:17 +000094 DidLaunch () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000095
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000096 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +000097 WillAttachToProcessWithID (lldb::pid_t pid) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +000098
Tamas Berghammer30b8cd32015-03-23 15:50:03 +000099 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000100 WillAttachToProcessWithName (const char *process_name, bool wait_for_launch) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000101
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000102 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000103 DoConnectRemote (lldb_private::Stream *strm, const char *remote_url) override;
Greg Claytonb766a732011-02-04 01:58:07 +0000104
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000105 lldb_private::Error
106 WillLaunchOrAttach ();
107
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000108 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000109 DoAttachToProcessWithID (lldb::pid_t pid) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000110
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000111 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000112 DoAttachToProcessWithID (lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info) override;
Han Ming Ong84647042012-02-25 01:07:38 +0000113
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000114 lldb_private::Error
Han Ming Ong84647042012-02-25 01:07:38 +0000115 DoAttachToProcessWithName (const char *process_name,
Eric Christopher7ab81b92014-11-04 03:13:17 +0000116 const lldb_private::ProcessAttachInfo &attach_info) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000117
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000118 void
Eric Christopher7ab81b92014-11-04 03:13:17 +0000119 DidAttach (lldb_private::ArchSpec &process_arch) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000120
121 //------------------------------------------------------------------
122 // PluginInterface protocol
123 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000124 lldb_private::ConstString
Eric Christopher7ab81b92014-11-04 03:13:17 +0000125 GetPluginName() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000126
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000127 uint32_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000128 GetPluginVersion() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000129
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000130 //------------------------------------------------------------------
131 // Process Control
132 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000133 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000134 WillResume () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000135
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000136 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000137 DoResume () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000138
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000139 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000140 DoHalt (bool &caused_stop) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000141
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000142 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000143 DoDetach (bool keep_stopped) override;
Jim Ingham8af3b9c2013-03-29 01:18:12 +0000144
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000145 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000146 DetachRequiresHalt() override { return true; }
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000147
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000148 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000149 DoSignal (int signal) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000150
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000151 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000152 DoDestroy () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000153
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000154 void
Eric Christopher7ab81b92014-11-04 03:13:17 +0000155 RefreshStateAfterStop() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000156
157 //------------------------------------------------------------------
158 // Process Queries
159 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000160 bool
Eric Christopher7ab81b92014-11-04 03:13:17 +0000161 IsAlive () override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000162
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000163 lldb::addr_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000164 GetImageInfoAddress() override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000165
166 //------------------------------------------------------------------
167 // Process Memory
168 //------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000169 size_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000170 DoReadMemory (lldb::addr_t addr, void *buf, size_t size, lldb_private::Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000171
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000172 size_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000173 DoWriteMemory (lldb::addr_t addr, const void *buf, size_t size, lldb_private::Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000174
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000175 lldb::addr_t
Eric Christopher7ab81b92014-11-04 03:13:17 +0000176 DoAllocateMemory (size_t size, uint32_t permissions, lldb_private::Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000177
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000178 lldb_private::Error
Greg Clayton46fb5582011-11-18 07:03:08 +0000179 GetMemoryRegionInfo (lldb::addr_t load_addr,
Eric Christopher7ab81b92014-11-04 03:13:17 +0000180 lldb_private::MemoryRegionInfo &region_info) override;
Greg Clayton46fb5582011-11-18 07:03:08 +0000181
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000182 lldb_private::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
Eric Christopher7ab81b92014-11-04 03:13:17 +0000189 PutSTDIN (const char *buf, size_t buf_size, lldb_private::Error &error) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000190
191 //----------------------------------------------------------------------
192 // Process Breakpoints
193 //----------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000194 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000195 EnableBreakpointSite (lldb_private::BreakpointSite *bp_site) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000196
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000197 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000198 DisableBreakpointSite (lldb_private::BreakpointSite *bp_site) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000199
200 //----------------------------------------------------------------------
201 // Process Watchpoints
202 //----------------------------------------------------------------------
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000203 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000204 EnableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000205
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000206 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000207 DisableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000208
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000209 lldb_private::Error
Eric Christopher7ab81b92014-11-04 03:13:17 +0000210 GetWatchpointSupportInfo (uint32_t &num) override;
Johnny Chen64637202012-05-23 21:09:52 +0000211
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000212 lldb_private::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 Berghammer30b8cd32015-03-23 15:50:03 +0000227 lldb_private::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
240 GetModuleSpec(const lldb_private::FileSpec& module_file_spec,
241 const lldb_private::ArchSpec& arch,
242 lldb_private::ModuleSpec &module_spec) override;
243
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
281 lldb_private::Flags &
282 GetFlags ()
283 {
284 return m_flags;
285 }
286
287 const lldb_private::Flags &
288 GetFlags () const
289 {
290 return m_flags;
291 }
292
Tamas Berghammer30b8cd32015-03-23 15:50:03 +0000293 bool
Greg Clayton56d9a1b2011-08-22 02:49:39 +0000294 UpdateThreadList (lldb_private::ThreadList &old_thread_list,
Eric Christopher7ab81b92014-11-04 03:13:17 +0000295 lldb_private::ThreadList &new_thread_list) override;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000296
297 lldb_private::Error
Greg Clayton91a9b2472013-12-04 19:19:12 +0000298 LaunchAndConnectToDebugserver (const lldb_private::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
310 ParsePythonTargetDefinition(const lldb_private::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
Jason Molenda705b1802014-06-13 02:37:02 +0000315 lldb_private::StructuredData::ObjectSP
316 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
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000331 lldb_private::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;
Greg Clayton09c3e3d2011-12-06 04:51:14 +0000335 lldb_private::Mutex m_last_stop_packet_mutex;
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000336 GDBRemoteDynamicRegisterInfo m_register_info;
337 lldb_private::Broadcaster m_async_broadcaster;
Zachary Turner39de3112014-09-09 20:54:56 +0000338 lldb_private::HostThread m_async_thread;
Jim Ingham455fa5c2012-11-01 01:15:33 +0000339 lldb_private::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
Jim Inghambb006ce2014-08-02 00:33:35 +0000383 DidLaunchOrAttach (lldb_private::ArchSpec& process_arch);
Chris Lattner30fdc8d2010-06-08 16:52:24 +0000384
385 lldb_private::Error
386 ConnectToDebugserver (const char *host_port);
387
388 const char *
389 GetDispatchQueueNameForThread (lldb::addr_t thread_dispatch_qaddr,
390 std::string &dispatch_queue_name);
391
Jason Molenda5e8534e2012-10-03 01:29:34 +0000392 lldb_private::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,
401 lldb_private::StoppointCallbackContext *context,
402 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
409#endif // liblldb_ProcessGDBRemote_h_