diff options
Diffstat (limited to 'include/lldb/Host/common')
-rw-r--r-- | include/lldb/Host/common/NativeBreakpointList.h | 10 | ||||
-rw-r--r-- | include/lldb/Host/common/NativeProcessProtocol.h | 37 | ||||
-rw-r--r-- | include/lldb/Host/common/NativeRegisterContext.h | 5 | ||||
-rw-r--r-- | include/lldb/Host/common/NativeRegisterContextRegisterInfo.h | 42 | ||||
-rw-r--r-- | include/lldb/Host/common/NativeThreadProtocol.h | 7 | ||||
-rw-r--r-- | include/lldb/Host/common/NativeWatchpointList.h | 2 | ||||
-rw-r--r-- | include/lldb/Host/common/UDPSocket.h | 4 |
7 files changed, 55 insertions, 52 deletions
diff --git a/include/lldb/Host/common/NativeBreakpointList.h b/include/lldb/Host/common/NativeBreakpointList.h index 2bb8e565f464..1d314e02b1d5 100644 --- a/include/lldb/Host/common/NativeBreakpointList.h +++ b/include/lldb/Host/common/NativeBreakpointList.h @@ -10,7 +10,7 @@ #ifndef liblldb_NativeBreakpointList_h_ #define liblldb_NativeBreakpointList_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" // #include "lldb/Host/NativeBreakpoint.h" @@ -19,6 +19,14 @@ #include <mutex> namespace lldb_private { + +struct HardwareBreakpoint { + lldb::addr_t m_addr; + size_t m_size; +}; + +using HardwareBreakpointMap = std::map<lldb::addr_t, HardwareBreakpoint>; + class NativeBreakpointList { public: typedef std::function<Error(lldb::addr_t addr, size_t size_hint, diff --git a/include/lldb/Host/common/NativeProcessProtocol.h b/include/lldb/Host/common/NativeProcessProtocol.h index a0f03b0dafa3..7ad09d41eacf 100644 --- a/include/lldb/Host/common/NativeProcessProtocol.h +++ b/include/lldb/Host/common/NativeProcessProtocol.h @@ -10,14 +10,15 @@ #ifndef liblldb_NativeProcessProtocol_h_ #define liblldb_NativeProcessProtocol_h_ -#include <mutex> -#include <vector> - -#include "lldb/Core/Error.h" #include "lldb/Host/MainLoop.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" #include "lldb/lldb-types.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Support/MemoryBuffer.h" +#include <vector> #include "NativeBreakpointList.h" #include "NativeWatchpointList.h" @@ -64,6 +65,12 @@ public: virtual Error Kill() = 0; + //------------------------------------------------------------------ + // Tells a process not to stop the inferior on given signals + // and just reinject them back. + //------------------------------------------------------------------ + virtual Error IgnoreSignals(llvm::ArrayRef<int> signals); + //---------------------------------------------------------------------- // Memory and memory region functions //---------------------------------------------------------------------- @@ -99,18 +106,28 @@ public: virtual Error SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) = 0; - virtual Error RemoveBreakpoint(lldb::addr_t addr); + virtual Error RemoveBreakpoint(lldb::addr_t addr, bool hardware = false); virtual Error EnableBreakpoint(lldb::addr_t addr); virtual Error DisableBreakpoint(lldb::addr_t addr); //---------------------------------------------------------------------- + // Hardware Breakpoint functions + //---------------------------------------------------------------------- + virtual const HardwareBreakpointMap &GetHardwareBreakpointMap() const; + + virtual Error SetHardwareBreakpoint(lldb::addr_t addr, size_t size); + + virtual Error RemoveHardwareBreakpoint(lldb::addr_t addr); + + //---------------------------------------------------------------------- // Watchpoint functions //---------------------------------------------------------------------- virtual const NativeWatchpointList::WatchpointMap &GetWatchpointMap() const; - virtual uint32_t GetMaxWatchpoints() const; + virtual llvm::Optional<std::pair<uint32_t, uint32_t>> + GetHardwareDebugSupportInfo() const; virtual Error SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware); @@ -134,6 +151,9 @@ public: bool GetByteOrder(lldb::ByteOrder &byte_order) const; + virtual llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> + GetAuxvData() const = 0; + //---------------------------------------------------------------------- // Exit Status //---------------------------------------------------------------------- @@ -305,9 +325,14 @@ protected: std::vector<NativeDelegate *> m_delegates; NativeBreakpointList m_breakpoint_list; NativeWatchpointList m_watchpoint_list; + HardwareBreakpointMap m_hw_breakpoints_map; int m_terminal_fd; uint32_t m_stop_id; + // Set of signal numbers that LLDB directly injects back to inferior + // without stopping it. + llvm::DenseSet<int> m_signals_to_ignore; + // lldb_private::Host calls should be used to launch a process for debugging, // and // then the process should be attached to. When attaching to a process diff --git a/include/lldb/Host/common/NativeRegisterContext.h b/include/lldb/Host/common/NativeRegisterContext.h index dd583d7866a8..1d8b51c60cc4 100644 --- a/include/lldb/Host/common/NativeRegisterContext.h +++ b/include/lldb/Host/common/NativeRegisterContext.h @@ -75,6 +75,11 @@ public: virtual bool ClearHardwareBreakpoint(uint32_t hw_idx); + virtual Error ClearAllHardwareBreakpoints(); + + virtual Error GetHardwareBreakHitIndex(uint32_t &bp_index, + lldb::addr_t trap_addr); + virtual uint32_t NumSupportedHardwareWatchpoints(); virtual uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, diff --git a/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h b/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h deleted file mode 100644 index 908989a0624e..000000000000 --- a/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h +++ /dev/null @@ -1,42 +0,0 @@ -//===-- NativeRegisterContextRegisterInfo.h ----------------------*- C++ -//-*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef lldb_NativeRegisterContextRegisterInfo_h -#define lldb_NativeRegisterContextRegisterInfo_h - -#include <memory> - -#include "NativeRegisterContext.h" -#include "Plugins/Process/Utility/RegisterInfoInterface.h" - -namespace lldb_private { -class NativeRegisterContextRegisterInfo : public NativeRegisterContext { -public: - /// - /// Construct a NativeRegisterContextRegisterInfo, taking ownership - /// of the register_info_interface pointer. - /// - NativeRegisterContextRegisterInfo( - NativeThreadProtocol &thread, uint32_t concrete_frame_idx, - RegisterInfoInterface *register_info_interface); - - uint32_t GetRegisterCount() const override; - - uint32_t GetUserRegisterCount() const override; - - const RegisterInfo *GetRegisterInfoAtIndex(uint32_t reg_index) const override; - - const RegisterInfoInterface &GetRegisterInfoInterface() const; - -private: - std::unique_ptr<RegisterInfoInterface> m_register_info_interface_up; -}; -} -#endif diff --git a/include/lldb/Host/common/NativeThreadProtocol.h b/include/lldb/Host/common/NativeThreadProtocol.h index 450e74630e71..8f26616a2b4a 100644 --- a/include/lldb/Host/common/NativeThreadProtocol.h +++ b/include/lldb/Host/common/NativeThreadProtocol.h @@ -56,6 +56,13 @@ public: virtual Error RemoveWatchpoint(lldb::addr_t addr) = 0; + // --------------------------------------------------------------------- + // Thread-specific Hardware Breakpoint routines + // --------------------------------------------------------------------- + virtual Error SetHardwareBreakpoint(lldb::addr_t addr, size_t size) = 0; + + virtual Error RemoveHardwareBreakpoint(lldb::addr_t addr) = 0; + protected: NativeProcessProtocolWP m_process_wp; lldb::tid_t m_tid; diff --git a/include/lldb/Host/common/NativeWatchpointList.h b/include/lldb/Host/common/NativeWatchpointList.h index 2424e5613332..ae3476f5f07e 100644 --- a/include/lldb/Host/common/NativeWatchpointList.h +++ b/include/lldb/Host/common/NativeWatchpointList.h @@ -10,7 +10,7 @@ #ifndef liblldb_NativeWatchpointList_h_ #define liblldb_NativeWatchpointList_h_ -#include "lldb/Core/Error.h" +#include "lldb/Utility/Error.h" #include "lldb/lldb-private-forward.h" #include <map> diff --git a/include/lldb/Host/common/UDPSocket.h b/include/lldb/Host/common/UDPSocket.h index 153804be2603..507c9827caf6 100644 --- a/include/lldb/Host/common/UDPSocket.h +++ b/include/lldb/Host/common/UDPSocket.h @@ -18,7 +18,7 @@ public: UDPSocket(bool child_processes_inherit, Error &error); static Error Connect(llvm::StringRef name, bool child_processes_inherit, - Socket *&send_socket, Socket *&recv_socket); + Socket *&socket); private: UDPSocket(NativeSocket socket); @@ -29,7 +29,7 @@ private: Error Accept(llvm::StringRef name, bool child_processes_inherit, Socket *&socket) override; - SocketAddress m_send_sockaddr; + SocketAddress m_sockaddr; }; } |