10b57cec5SDimitry Andric //===-- NativeRegisterContextNetBSD.cpp -----------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #include "NativeRegisterContextNetBSD.h"
100b57cec5SDimitry Andric 
110b57cec5SDimitry Andric #include "Plugins/Process/NetBSD/NativeProcessNetBSD.h"
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric #include "lldb/Host/common/NativeProcessProtocol.h"
140b57cec5SDimitry Andric 
150b57cec5SDimitry Andric using namespace lldb_private;
160b57cec5SDimitry Andric using namespace lldb_private::process_netbsd;
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric // clang-format off
190b57cec5SDimitry Andric #include <sys/types.h>
200b57cec5SDimitry Andric #include <sys/ptrace.h>
210b57cec5SDimitry Andric // clang-format on
220b57cec5SDimitry Andric 
DoRegisterSet(int ptrace_req,void * buf)230b57cec5SDimitry Andric Status NativeRegisterContextNetBSD::DoRegisterSet(int ptrace_req, void *buf) {
240b57cec5SDimitry Andric   return NativeProcessNetBSD::PtraceWrapper(ptrace_req, GetProcessPid(), buf,
250b57cec5SDimitry Andric                                             m_thread.GetID());
260b57cec5SDimitry Andric }
270b57cec5SDimitry Andric 
GetProcess()280b57cec5SDimitry Andric NativeProcessNetBSD &NativeRegisterContextNetBSD::GetProcess() {
290b57cec5SDimitry Andric   return static_cast<NativeProcessNetBSD &>(m_thread.GetProcess());
300b57cec5SDimitry Andric }
310b57cec5SDimitry Andric 
GetProcessPid()320b57cec5SDimitry Andric ::pid_t NativeRegisterContextNetBSD::GetProcessPid() {
330b57cec5SDimitry Andric   return GetProcess().GetID();
340b57cec5SDimitry Andric }
350b57cec5SDimitry Andric