1*80814287SRaphael Isemann //===-- NativeRegisterContextNetBSD.cpp -----------------------------------===//
21a3d19ddSKamil Rytarowski //
32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
61a3d19ddSKamil Rytarowski //
71a3d19ddSKamil Rytarowski //===----------------------------------------------------------------------===//
81a3d19ddSKamil Rytarowski 
91a3d19ddSKamil Rytarowski #include "NativeRegisterContextNetBSD.h"
101a3d19ddSKamil Rytarowski 
11d970d4d4SMichał Górny #include "Plugins/Process/NetBSD/NativeProcessNetBSD.h"
12d970d4d4SMichał Górny 
13f07a9995SKamil Rytarowski #include "lldb/Host/common/NativeProcessProtocol.h"
14f07a9995SKamil Rytarowski 
151a3d19ddSKamil Rytarowski using namespace lldb_private;
161a3d19ddSKamil Rytarowski using namespace lldb_private::process_netbsd;
171a3d19ddSKamil Rytarowski 
18f07a9995SKamil Rytarowski // clang-format off
19f07a9995SKamil Rytarowski #include <sys/types.h>
20f07a9995SKamil Rytarowski #include <sys/ptrace.h>
21f07a9995SKamil Rytarowski // clang-format on
22f07a9995SKamil Rytarowski 
DoRegisterSet(int ptrace_req,void * buf)23d687fa7dSMichal Gorny Status NativeRegisterContextNetBSD::DoRegisterSet(int ptrace_req, void *buf) {
24d687fa7dSMichal Gorny   return NativeProcessNetBSD::PtraceWrapper(ptrace_req, GetProcessPid(), buf,
2536e23ecaSKamil Rytarowski                                             m_thread.GetID());
2636e23ecaSKamil Rytarowski }
2736e23ecaSKamil Rytarowski 
GetProcess()28f07a9995SKamil Rytarowski NativeProcessNetBSD &NativeRegisterContextNetBSD::GetProcess() {
2982abefa4SPavel Labath   return static_cast<NativeProcessNetBSD &>(m_thread.GetProcess());
30f07a9995SKamil Rytarowski }
31f07a9995SKamil Rytarowski 
GetProcessPid()32f07a9995SKamil Rytarowski ::pid_t NativeRegisterContextNetBSD::GetProcessPid() {
3382abefa4SPavel Labath   return GetProcess().GetID();
34f07a9995SKamil Rytarowski }
35