1 //===-- NativeRegisterContextNetBSD.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 lldb_NativeRegisterContextNetBSD_h 11 #define lldb_NativeRegisterContextNetBSD_h 12 13 #include "lldb/Host/common/NativeThreadProtocol.h" 14 15 #include "Plugins/Process/NetBSD/NativeProcessNetBSD.h" 16 #include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h" 17 18 namespace lldb_private { 19 namespace process_netbsd { 20 21 class NativeRegisterContextNetBSD : public NativeRegisterContextRegisterInfo { 22 public: 23 NativeRegisterContextNetBSD(NativeThreadProtocol &native_thread, 24 uint32_t concrete_frame_idx, 25 RegisterInfoInterface *reg_info_interface_p); 26 27 // This function is implemented in the NativeRegisterContextNetBSD_* 28 // subclasses to create a new instance of the host specific 29 // NativeRegisterContextNetBSD. The implementations can't collide as only one 30 // NativeRegisterContextNetBSD_* variant should be compiled into the final 31 // executable. 32 static NativeRegisterContextNetBSD * 33 CreateHostNativeRegisterContextNetBSD(const ArchSpec &target_arch, 34 NativeThreadProtocol &native_thread, 35 uint32_t concrete_frame_idx); 36 37 protected: 38 virtual Error ReadGPR(); 39 virtual Error WriteGPR(); 40 41 virtual Error ReadFPR(); 42 virtual Error WriteFPR(); 43 44 virtual void *GetGPRBuffer() { return nullptr; } 45 virtual size_t GetGPRSize() { 46 return GetRegisterInfoInterface().GetGPRSize(); 47 } 48 49 virtual void *GetFPRBuffer() { return nullptr; } 50 virtual size_t GetFPRSize() { return 0; } 51 52 virtual Error DoReadGPR(void *buf); 53 virtual Error DoWriteGPR(void *buf); 54 55 virtual Error DoReadFPR(void *buf); 56 virtual Error DoWriteFPR(void *buf); 57 58 virtual NativeProcessNetBSD &GetProcess(); 59 virtual ::pid_t GetProcessPid(); 60 }; 61 62 } // namespace process_netbsd 63 } // namespace lldb_private 64 65 #endif // #ifndef lldb_NativeRegisterContextNetBSD_h 66