1*0b57cec5SDimitry Andric //===-- NativeRegisterContextNetBSD.cpp -----------------------------------===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric 9*0b57cec5SDimitry Andric #include "NativeRegisterContextNetBSD.h" 10*0b57cec5SDimitry Andric 11*0b57cec5SDimitry Andric #include "Plugins/Process/NetBSD/NativeProcessNetBSD.h" 12*0b57cec5SDimitry Andric 13*0b57cec5SDimitry Andric #include "lldb/Host/common/NativeProcessProtocol.h" 14*0b57cec5SDimitry Andric 15*0b57cec5SDimitry Andric using namespace lldb_private; 16*0b57cec5SDimitry Andric using namespace lldb_private::process_netbsd; 17*0b57cec5SDimitry Andric 18*0b57cec5SDimitry Andric // clang-format off 19*0b57cec5SDimitry Andric #include <sys/types.h> 20*0b57cec5SDimitry Andric #include <sys/ptrace.h> 21*0b57cec5SDimitry Andric // clang-format on 22*0b57cec5SDimitry Andric DoRegisterSet(int ptrace_req,void * buf)23*0b57cec5SDimitry AndricStatus NativeRegisterContextNetBSD::DoRegisterSet(int ptrace_req, void *buf) { 24*0b57cec5SDimitry Andric return NativeProcessNetBSD::PtraceWrapper(ptrace_req, GetProcessPid(), buf, 25*0b57cec5SDimitry Andric m_thread.GetID()); 26*0b57cec5SDimitry Andric } 27*0b57cec5SDimitry Andric GetProcess()28*0b57cec5SDimitry AndricNativeProcessNetBSD &NativeRegisterContextNetBSD::GetProcess() { 29*0b57cec5SDimitry Andric return static_cast<NativeProcessNetBSD &>(m_thread.GetProcess()); 30*0b57cec5SDimitry Andric } 31*0b57cec5SDimitry Andric GetProcessPid()32*0b57cec5SDimitry Andric::pid_t NativeRegisterContextNetBSD::GetProcessPid() { 33*0b57cec5SDimitry Andric return GetProcess().GetID(); 34*0b57cec5SDimitry Andric } 35*0b57cec5SDimitry Andric