LLDB mainline
NativeProcessProtocol.h
Go to the documentation of this file.
1//===-- NativeProcessProtocol.h ---------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_HOST_COMMON_NATIVEPROCESSPROTOCOL_H
10#define LLDB_HOST_COMMON_NATIVEPROCESSPROTOCOL_H
11
15#include "lldb/Host/Host.h"
16#include "lldb/Host/MainLoop.h"
22#include "lldb/Utility/Status.h"
26#include "lldb/lldb-types.h"
27#include "llvm/ADT/ArrayRef.h"
28#include "llvm/ADT/DenseSet.h"
29#include "llvm/ADT/StringRef.h"
30#include "llvm/Support/Error.h"
31#include "llvm/Support/MemoryBuffer.h"
32#include <map>
33#include <mutex>
34#include <optional>
35#include <vector>
36
37namespace lldb_private {
39
42
50
51/// Generic loaded-library entry used by the non-SVR4 `qXfer:libraries:read`
52/// form of the GDB remote library-list protocol (PE on Windows).
57
58// NativeProcessProtocol
60public:
61 virtual ~NativeProcessProtocol() = default;
62
63 typedef std::vector<std::unique_ptr<NativeThreadProtocol>> thread_collection;
65 std::recursive_mutex, thread_collection,
66 llvm::pointee_iterator<thread_collection::const_iterator>>
68
69 virtual Status Resume(const ResumeActionList &resume_actions) = 0;
70
71 virtual Status Halt() = 0;
72
73 virtual Status Detach() = 0;
74
75 /// Sends a process a UNIX signal \a signal.
76 ///
77 /// \return
78 /// Returns an error object.
79 virtual Status Signal(int signo) = 0;
80
81 /// Tells a process to interrupt all operations as if by a Ctrl-C.
82 ///
83 /// The default implementation will send a local host's equivalent of
84 /// a SIGSTOP to the process via the NativeProcessProtocol::Signal()
85 /// operation.
86 ///
87 /// \return
88 /// Returns an error object.
89 virtual Status Interrupt();
90
91 virtual Status Kill() = 0;
92
93 // Tells a process not to stop the inferior on given signals and just
94 // reinject them back.
95 virtual Status IgnoreSignals(llvm::ArrayRef<int> signals);
96
97 // Memory and memory region functions
98
99 virtual Status GetMemoryRegionInfo(lldb::addr_t load_addr,
100 MemoryRegionInfo &range_info);
101
102 /// Served over the "jAddressSpacesInfo" packet.
103 virtual std::vector<AddressSpaceInfo> GetAddressSpaces() { return {}; }
104
105 /// Plugins without address spaces should error on a non-default one.
106 virtual Status ReadMemory(const ProcessAddress &addr, void *buf, size_t size,
107 size_t &bytes_read) = 0;
108
109 Status ReadMemoryWithoutTrap(const ProcessAddress &addr, void *buf,
110 size_t size, size_t &bytes_read);
111
112 virtual Status ReadMemoryTags(int32_t type, lldb::addr_t addr, size_t len,
113 std::vector<uint8_t> &tags);
114
115 virtual Status WriteMemoryTags(int32_t type, lldb::addr_t addr, size_t len,
116 const std::vector<uint8_t> &tags);
117
118 /// Reads a null-terminated string from memory.
119 ///
120 /// Reads up to \p max_size bytes of memory until it finds a '\0'.
121 /// If a '\0' is not found then it reads max_size-1 bytes as a string and a
122 /// '\0' is added as the last character of the \p buffer.
123 ///
124 /// \param[in] addr
125 /// The address in memory to read from.
126 ///
127 /// \param[in] buffer
128 /// An allocated buffer with at least \p max_size size.
129 ///
130 /// \param[in] max_size
131 /// The maximum number of bytes to read from memory until it reads the
132 /// string.
133 ///
134 /// \param[out] total_bytes_read
135 /// The number of bytes read from memory into \p buffer.
136 ///
137 /// \return
138 /// Returns a StringRef backed up by the \p buffer passed in.
139 llvm::Expected<llvm::StringRef>
140 ReadCStringFromMemory(lldb::addr_t addr, char *buffer, size_t max_size,
141 size_t &total_bytes_read);
142
143 /// Write memory while not overwriting breakpoints in memory. The breakpoints'
144 /// saved bytes are updated with what would have been written.
145 Status WriteMemory(lldb::addr_t addr, const void *buf, size_t size,
146 size_t &bytes_written);
147
148 virtual llvm::Expected<lldb::addr_t> AllocateMemory(size_t size,
149 uint32_t permissions) {
150 return llvm::make_error<UnimplementedError>();
151 }
152
153 virtual llvm::Error DeallocateMemory(lldb::addr_t addr) {
154 return llvm::make_error<UnimplementedError>();
155 }
156
158
159 virtual llvm::Expected<std::vector<SVR4LibraryInfo>>
161 return llvm::createStringError(llvm::inconvertibleErrorCode(),
162 "Not implemented");
163 }
164
165 /// Return the currently loaded libraries of the target in the
166 /// `qXfer:libraries:read` form (generic name + base address pairs; used on
167 /// Windows, where the inferior is not SVR4 and the module list comes from
168 /// the PE loader).
169 virtual llvm::Expected<std::vector<LoadedLibraryInfo>> GetLoadedLibraries() {
170 return llvm::createStringError(llvm::inconvertibleErrorCode(),
171 "Not implemented");
172 }
173
174 /// Answers "jAcceleratorPluginGetDynamicLoaderLibraryInfo" on an accelerator
175 /// connection. std::nullopt if this process does not provide libraries.
176 virtual std::optional<AcceleratorDynamicLoaderResponse>
178 const AcceleratorDynamicLoaderArgs &args) {
179 return std::nullopt;
180 }
181
182 virtual bool HasPendingLibraryEvents() { return false; }
183
184 virtual bool IsAlive() const;
185
186 virtual size_t UpdateThreads() = 0;
187
188 virtual const ArchSpec &GetArchitecture() const = 0;
189
190 // Breakpoint functions
191 virtual Status SetBreakpoint(lldb::addr_t addr, uint32_t size,
192 bool hardware) = 0;
193
194 virtual Status RemoveBreakpoint(lldb::addr_t addr, bool hardware = false);
195
197 return m_software_breakpoints.find(addr) != m_software_breakpoints.end();
198 }
199
200 // Hardware Breakpoint functions
201 virtual const HardwareBreakpointMap &GetHardwareBreakpointMap() const;
202
203 virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size);
204
206
207 // Watchpoint functions
209
210 virtual std::optional<std::pair<uint32_t, uint32_t>>
212
213 virtual Status SetWatchpoint(lldb::addr_t addr, size_t size,
214 uint32_t watch_flags, bool hardware);
215
217
218 // Accessors
219 lldb::pid_t GetID() const { return m_pid; }
220
222
223 bool IsRunning() const {
225 }
226
227 bool IsStepping() const { return m_state == lldb::eStateStepping; }
228
229 bool CanResume() const { return m_state == lldb::eStateStopped; }
230
234
235 uint32_t GetAddressByteSize() const {
237 }
238
239 virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
240 GetAuxvData() const = 0;
241
242 // Exit Status
243 virtual std::optional<WaitStatus> GetExitStatus();
244
245 virtual bool SetExitStatus(WaitStatus status, bool bNotifyStateChange);
246
247 // Access to threads
249
251
253
255
259
263
264 // Access to inferior stdio
265 virtual int GetTerminalFileDescriptor() { return m_terminal_fd; }
266
267 /// Write up to \p len bytes from \p buf to the inferior's stdin.
268 virtual size_t WriteStdin(const void *buf, size_t len, Status &error) {
269 return 0;
270 }
271
272 // Stop id interface
273 uint32_t GetStopID() const;
274
275 // Callbacks for low-level process state changes
277 public:
278 virtual ~NativeDelegate() = default;
279
280 virtual void InitializeDelegate(NativeProcessProtocol *process) = 0;
281
283 lldb::StateType state) = 0;
284
285 virtual void DidExec(NativeProcessProtocol *process) = 0;
286
287 virtual void
289 std::unique_ptr<NativeProcessProtocol> child_process) = 0;
290
291 /// Called by the platform when the inferior writes to stdout/stderr
292 /// through a redirected pseudoconsole that the platform owns.
294 llvm::StringRef data) {}
295 };
296
297 virtual Status GetLoadedModuleFileSpec(const char *module_path,
298 FileSpec &file_spec) = 0;
299
300 virtual Status GetFileLoadAddress(const llvm::StringRef &file_name,
301 lldb::addr_t &load_addr) = 0;
302
303 /// Extension flag constants, returned by Manager::GetSupportedExtensions()
304 /// and passed to SetEnabledExtension()
305 enum class Extension {
306 multiprocess = (1u << 0),
307 fork = (1u << 1),
308 vfork = (1u << 2),
309 pass_signals = (1u << 3),
310 auxv = (1u << 4),
311 libraries_svr4 = (1u << 5),
312 memory_tagging = (1u << 6),
313 savecore = (1u << 7),
314 siginfo_read = (1u << 8),
315 libraries = (1u << 9),
317 address_spaces = (1u << 11),
318 lldb_settings = (1u << 12),
319
321 };
322
323 class Manager {
324 public:
325 Manager(MainLoop &mainloop) : m_mainloop(mainloop) {}
326 Manager(const Manager &) = delete;
327 Manager &operator=(const Manager &) = delete;
328
329 virtual ~Manager();
330
331 /// Launch a process for debugging.
332 ///
333 /// \param[in] launch_info
334 /// Information required to launch the process.
335 ///
336 /// \param[in] native_delegate
337 /// The delegate that will receive messages regarding the
338 /// inferior. Must outlive the NativeProcessProtocol
339 /// instance.
340 ///
341 /// \param[in] mainloop
342 /// The mainloop instance with which the process can register
343 /// callbacks. Must outlive the NativeProcessProtocol
344 /// instance.
345 ///
346 /// \return
347 /// A NativeProcessProtocol shared pointer if the operation succeeded or
348 /// an error object if it failed.
349 virtual llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
351 NativeDelegate &native_delegate) = 0;
352
353 /// Attach to an existing process.
354 ///
355 /// \param[in] pid
356 /// pid of the process locatable
357 ///
358 /// \param[in] native_delegate
359 /// The delegate that will receive messages regarding the
360 /// inferior. Must outlive the NativeProcessProtocol
361 /// instance.
362 ///
363 /// \param[in] mainloop
364 /// The mainloop instance with which the process can register
365 /// callbacks. Must outlive the NativeProcessProtocol
366 /// instance.
367 ///
368 /// \return
369 /// A NativeProcessProtocol shared pointer if the operation succeeded or
370 /// an error object if it failed.
371 virtual llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
372 Attach(lldb::pid_t pid, NativeDelegate &native_delegate) = 0;
373
374 /// Get the bitmask of extensions supported by this process plugin.
375 ///
376 /// \return
377 /// A NativeProcessProtocol::Extension bitmask.
378 virtual Extension GetSupportedExtensions() const { return {}; }
379
380 protected:
382 };
383
384 /// Notify tracers that the target process will resume
386
387 /// Notify tracers that the target process just stopped
389
390 /// Start tracing a process or its threads.
391 ///
392 /// \param[in] json_params
393 /// JSON object with the information of what and how to trace.
394 /// In the case of gdb-remote, this object should conform to the
395 /// jLLDBTraceStart packet.
396 ///
397 /// This object should have a string entry called "type", which is the
398 /// tracing technology name.
399 ///
400 /// \param[in] type
401 /// Tracing technology type, as described in the \a json_params.
402 ///
403 /// \return
404 /// \a llvm::Error::success if the operation was successful, or an
405 /// \a llvm::Error otherwise.
406 virtual llvm::Error TraceStart(llvm::StringRef json_params,
407 llvm::StringRef type) {
408 return llvm::createStringError(llvm::inconvertibleErrorCode(),
409 "Unsupported tracing type '%s'",
410 type.data());
411 }
412
413 /// \copydoc Process::TraceStop(const TraceStopRequest &)
414 virtual llvm::Error TraceStop(const TraceStopRequest &request) {
415 return llvm::createStringError(llvm::inconvertibleErrorCode(),
416 "Unsupported tracing type '%s'",
417 request.type.data());
418 }
419
420 /// \copydoc Process::TraceGetState(llvm::StringRef type)
421 virtual llvm::Expected<llvm::json::Value>
422 TraceGetState(llvm::StringRef type) {
423 return llvm::createStringError(llvm::inconvertibleErrorCode(),
424 "Unsupported tracing type '%s'",
425 type.data());
426 }
427
428 /// \copydoc Process::TraceGetBinaryData(const TraceGetBinaryDataRequest &)
429 virtual llvm::Expected<std::vector<uint8_t>>
431 return llvm::createStringError(
432 llvm::inconvertibleErrorCode(),
433 "Unsupported data kind '%s' for the '%s' tracing technology",
434 request.kind.c_str(), request.type.c_str());
435 }
436
437 /// \copydoc Process::TraceSupported()
438 virtual llvm::Expected<TraceSupportedResponse> TraceSupported() {
439 return llvm::make_error<UnimplementedError>();
440 }
441
442 /// Method called in order to propagate the bitmap of protocol
443 /// extensions supported by the client.
444 ///
445 /// \param[in] flags
446 /// The bitmap of enabled extensions.
447 virtual void SetEnabledExtensions(Extension flags) {
448 m_enabled_extensions = flags;
449 }
450
451 /// Write a core dump (without crashing the program).
452 ///
453 /// \param[in] path_hint
454 /// Suggested core dump path (optional, can be empty).
455 ///
456 /// \return
457 /// Path to the core dump if successfully written, an error
458 /// otherwise.
459 virtual llvm::Expected<std::string> SaveCore(llvm::StringRef path_hint) {
460 return llvm::createStringError(llvm::inconvertibleErrorCode(),
461 "Not implemented");
462 }
463
464 /// Get the list of structured data plugins supported by this process. They
465 /// must match the `type` field used by the corresponding
466 /// StructuredDataPlugins in the client.
467 ///
468 /// \return
469 /// A vector of structured data plugin names.
470 virtual std::vector<std::string> GetStructuredDataPlugins() { return {}; };
471
472protected:
474 llvm::SmallVector<uint8_t, 4> saved_opcodes;
475 llvm::ArrayRef<uint8_t> breakpoint_opcodes;
476 };
477
478 // Using std::map so that breakpoints are sorted in ascending address order.
479 // WriteMemory relies on this.
480 std::map<lldb::addr_t, SoftwareBreakpoint> m_software_breakpoints;
482
483 std::vector<std::unique_ptr<NativeThreadProtocol>> m_threads;
485 mutable std::recursive_mutex m_threads_mutex;
486
488 mutable std::recursive_mutex m_state_mutex;
489
490 std::optional<WaitStatus> m_exit_status;
491
496 uint32_t m_stop_id = 0;
497
498 // Set of signal numbers that LLDB directly injects back to inferior without
499 // stopping it.
500 llvm::DenseSet<int> m_signals_to_ignore;
501
502 // Extensions enabled per the last SetEnabledExtensions() call.
504
505 // Write to memory, with no awareness of software breakpoint sites. Used to
506 // implement WriteMemory. May be called directly for use cases that should
507 // ignore software breakpoint sites, for example adding or removing those
508 // breakpoints.
509 virtual Status DoWriteMemory(lldb::addr_t addr, const void *buf, size_t size,
510 size_t &bytes_written) = 0;
511
512 // lldb_private::Host calls should be used to launch a process for debugging,
513 // and then the process should be attached to. When attaching to a process
514 // lldb_private::Host calls should be used to locate the process to attach
515 // to, and then this function should be called.
516 NativeProcessProtocol(lldb::pid_t pid, int terminal_fd,
517 NativeDelegate &delegate);
518
519 void SetID(lldb::pid_t pid) { m_pid = pid; }
520
521 // interface for state handling
522 void SetState(lldb::StateType state, bool notify_delegates = true);
523
524 // Derived classes need not implement this. It can be used as a hook to
525 // clear internal caches that should be invalidated when stop ids change.
526 //
527 // Note this function is called with the state mutex obtained by the caller.
528 virtual void DoStopIDBumped(uint32_t newBumpId);
529
530 // interface for software breakpoints
531
532 Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint);
534
535 virtual llvm::Expected<llvm::ArrayRef<uint8_t>>
536 GetSoftwareBreakpointTrapOpcode(size_t size_hint);
537
538 /// Return the offset of the PC relative to the software breakpoint that was hit. If an
539 /// architecture (e.g. arm) reports breakpoint hits before incrementing the PC, this offset
540 /// will be 0. If an architecture (e.g. intel) reports breakpoints hits after incrementing the
541 /// PC, this offset will be the size of the breakpoint opcode.
542 virtual size_t GetSoftwareBreakpointPCOffset();
543
544 // Adjust the thread's PC after hitting a software breakpoint. On
545 // architectures where the PC points after the breakpoint instruction, this
546 // resets it to point to the breakpoint itself.
548
549 /// Notify the delegate that an exec occurred.
550 ///
551 /// Provide a mechanism for a delegate to clear out any exec-
552 /// sensitive data.
553 virtual void NotifyDidExec();
554
556
557 /// Notify the delegates of \p state. For plugins that set a state with
558 /// SetState(state, /*notify_delegates=*/false) and report it later.
560
561private:
562 llvm::Expected<SoftwareBreakpoint>
563 EnableSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint);
564};
565} // namespace lldb_private
566
567#endif // LLDB_HOST_COMMON_NATIVEPROCESSPROTOCOL_H
static llvm::raw_ostream & error(Stream &strm)
An architecture specification class.
Definition ArchSpec.h:32
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition ArchSpec.cpp:710
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
Definition ArchSpec.cpp:759
A file utility class.
Definition FileSpec.h:56
Manager & operator=(const Manager &)=delete
virtual llvm::Expected< std::unique_ptr< NativeProcessProtocol > > Attach(lldb::pid_t pid, NativeDelegate &native_delegate)=0
Attach to an existing process.
virtual llvm::Expected< std::unique_ptr< NativeProcessProtocol > > Launch(ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate)=0
Launch a process for debugging.
virtual Extension GetSupportedExtensions() const
Get the bitmask of extensions supported by this process plugin.
virtual void ProcessStateChanged(NativeProcessProtocol *process, lldb::StateType state)=0
virtual void DidExec(NativeProcessProtocol *process)=0
virtual void NewSubprocess(NativeProcessProtocol *parent_process, std::unique_ptr< NativeProcessProtocol > child_process)=0
virtual void NewProcessOutput(NativeProcessProtocol *process, llvm::StringRef data)
Called by the platform when the inferior writes to stdout/stderr through a redirected pseudoconsole t...
virtual void InitializeDelegate(NativeProcessProtocol *process)=0
virtual Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware)
virtual lldb::addr_t GetSharedLibraryInfoAddress()=0
virtual Status ReadMemoryTags(int32_t type, lldb::addr_t addr, size_t len, std::vector< uint8_t > &tags)
llvm::Expected< SoftwareBreakpoint > EnableSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint)
virtual llvm::Expected< TraceSupportedResponse > TraceSupported()
Get the processor tracing type supported for this process.
virtual Status GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info)
std::vector< std::unique_ptr< NativeThreadProtocol > > thread_collection
virtual std::vector< std::string > GetStructuredDataPlugins()
Get the list of structured data plugins supported by this process.
virtual std::vector< AddressSpaceInfo > GetAddressSpaces()
Served over the "jAddressSpacesInfo" packet.
virtual void NotifyTracersProcessWillResume()
Notify tracers that the target process will resume.
virtual void NotifyTracersProcessDidStop()
Notify tracers that the target process just stopped.
virtual std::optional< WaitStatus > GetExitStatus()
virtual void SetEnabledExtensions(Extension flags)
Method called in order to propagate the bitmap of protocol extensions supported by the client.
virtual Status RemoveWatchpoint(lldb::addr_t addr)
virtual Status Interrupt()
Tells a process to interrupt all operations as if by a Ctrl-C.
virtual Status WriteMemoryTags(int32_t type, lldb::addr_t addr, size_t len, const std::vector< uint8_t > &tags)
virtual void DoStopIDBumped(uint32_t newBumpId)
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd, NativeDelegate &delegate)
virtual llvm::Expected< std::vector< SVR4LibraryInfo > > GetLoadedSVR4Libraries()
virtual size_t GetSoftwareBreakpointPCOffset()
Return the offset of the PC relative to the software breakpoint that was hit.
virtual llvm::Expected< std::vector< uint8_t > > TraceGetBinaryData(const TraceGetBinaryDataRequest &request)
Get binary data given a trace technology and a data identifier.
virtual const HardwareBreakpointMap & GetHardwareBreakpointMap() const
virtual llvm::Error TraceStop(const TraceStopRequest &request)
Stop tracing a live process or its threads.
virtual Status GetLoadedModuleFileSpec(const char *module_path, FileSpec &file_spec)=0
Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint)
virtual Status IgnoreSignals(llvm::ArrayRef< int > signals)
virtual llvm::Expected< std::vector< LoadedLibraryInfo > > GetLoadedLibraries()
Return the currently loaded libraries of the target in the qXfer:libraries:read form (generic name + ...
NativeThreadProtocol * GetThreadByIDUnlocked(lldb::tid_t tid)
virtual llvm::Expected< llvm::json::Value > TraceGetState(llvm::StringRef type)
Get the current tracing state of the process and its threads.
virtual Status SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware)=0
virtual const ArchSpec & GetArchitecture() const =0
LockingAdaptedIterable< std::recursive_mutex, thread_collection, llvm::pointee_iterator< thread_collection::const_iterator > > ThreadIterable
virtual const NativeWatchpointList::WatchpointMap & GetWatchpointMap() const
virtual llvm::Error DeallocateMemory(lldb::addr_t addr)
void SetState(lldb::StateType state, bool notify_delegates=true)
llvm::Expected< llvm::StringRef > ReadCStringFromMemory(lldb::addr_t addr, char *buffer, size_t max_size, size_t &total_bytes_read)
Reads a null-terminated string from memory.
virtual Status DoWriteMemory(lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written)=0
NativeThreadProtocol * GetThreadByID(lldb::tid_t tid)
virtual Status GetFileLoadAddress(const llvm::StringRef &file_name, lldb::addr_t &load_addr)=0
Status ReadMemoryWithoutTrap(const ProcessAddress &addr, void *buf, size_t size, size_t &bytes_read)
void SynchronouslyNotifyProcessStateChanged(lldb::StateType state)
Notify the delegates of state.
virtual llvm::Expected< std::string > SaveCore(llvm::StringRef path_hint)
Write a core dump (without crashing the program).
Status WriteMemory(lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written)
Write memory while not overwriting breakpoints in memory.
std::vector< std::unique_ptr< NativeThreadProtocol > > m_threads
std::optional< WaitStatus > m_exit_status
virtual bool SetExitStatus(WaitStatus status, bool bNotifyStateChange)
virtual Status RemoveBreakpoint(lldb::addr_t addr, bool hardware=false)
virtual size_t WriteStdin(const void *buf, size_t len, Status &error)
Write up to len bytes from buf to the inferior's stdin.
virtual Status Resume(const ResumeActionList &resume_actions)=0
virtual ~NativeProcessProtocol()=default
virtual Status Signal(int signo)=0
Sends a process a UNIX signal signal.
Status RemoveSoftwareBreakpoint(lldb::addr_t addr)
void FixupBreakpointPCAsNeeded(NativeThreadProtocol &thread)
NativeThreadProtocol * GetThreadAtIndex(uint32_t idx)
virtual void NotifyDidExec()
Notify the delegate that an exec occurred.
virtual Status ReadMemory(const ProcessAddress &addr, void *buf, size_t size, size_t &bytes_read)=0
Plugins without address spaces should error on a non-default one.
virtual llvm::Expected< lldb::addr_t > AllocateMemory(size_t size, uint32_t permissions)
Extension
Extension flag constants, returned by Manager::GetSupportedExtensions() and passed to SetEnabledExten...
virtual Status SetHardwareBreakpoint(lldb::addr_t addr, size_t size)
std::map< lldb::addr_t, SoftwareBreakpoint > m_software_breakpoints
virtual llvm::ErrorOr< std::unique_ptr< llvm::MemoryBuffer > > GetAuxvData() const =0
virtual std::optional< std::pair< uint32_t, uint32_t > > GetHardwareDebugSupportInfo() const
virtual std::optional< AcceleratorDynamicLoaderResponse > GetAcceleratorDynamicLoaderLibraryInfos(const AcceleratorDynamicLoaderArgs &args)
Answers "jAcceleratorPluginGetDynamicLoaderLibraryInfo" on an accelerator connection.
virtual llvm::Expected< llvm::ArrayRef< uint8_t > > GetSoftwareBreakpointTrapOpcode(size_t size_hint)
virtual llvm::Error TraceStart(llvm::StringRef json_params, llvm::StringRef type)
Start tracing a process or its threads.
virtual Status RemoveHardwareBreakpoint(lldb::addr_t addr)
std::map< lldb::addr_t, NativeWatchpoint > WatchpointMap
An address in a process, qualified by an address space.
An error handling class.
Definition Status.h:118
#define LLDB_INVALID_THREAD_ID
A class that represents a running process on the host machine.
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE()
MainLoopPosix MainLoop
Definition MainLoop.h:20
std::map< lldb::addr_t, HardwareBreakpoint > HardwareBreakpointMap
StateType
Process and Thread States.
@ eStateStopped
Process or thread is stopped and can be examined.
@ eStateRunning
Process or thread is running and can't be examined.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
uint64_t pid_t
Definition lldb-types.h:84
ByteOrder
Byte ordering definitions.
uint64_t addr_t
Definition lldb-types.h:80
uint64_t tid_t
Definition lldb-types.h:85
Arguments for the jAcceleratorPluginGetDynamicLoaderLibraryInfo packet.
Generic loaded-library entry used by the non-SVR4 qXfer:libraries:read form of the GDB remote library...
jLLDBTraceGetBinaryData gdb-remote packet
std::string kind
Identifier for the data.
std::string type
Tracing technology name, e.g. intel-pt, arm-coresight.
jLLDBTraceStop gdb-remote packet
std::string type
Tracing technology name, e.g. intel-pt, arm-coresight.