11a3d19ddSKamil Rytarowski //===-- NativeRegisterContextNetBSD.cpp -------------------------*- C++ -*-===// 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 11*d970d4d4SMichał Górny #include "Plugins/Process/NetBSD/NativeProcessNetBSD.h" 12*d970d4d4SMichał 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 231a3d19ddSKamil Rytarowski NativeRegisterContextNetBSD::NativeRegisterContextNetBSD( 24d37349f3SPavel Labath NativeThreadProtocol &native_thread, 251a3d19ddSKamil Rytarowski RegisterInfoInterface *reg_info_interface_p) 26d37349f3SPavel Labath : NativeRegisterContextRegisterInfo(native_thread, 271a3d19ddSKamil Rytarowski reg_info_interface_p) {} 28f07a9995SKamil Rytarowski 29d687fa7dSMichal Gorny Status NativeRegisterContextNetBSD::DoRegisterSet(int ptrace_req, void *buf) { 30d687fa7dSMichal Gorny return NativeProcessNetBSD::PtraceWrapper(ptrace_req, GetProcessPid(), buf, 3136e23ecaSKamil Rytarowski m_thread.GetID()); 3236e23ecaSKamil Rytarowski } 3336e23ecaSKamil Rytarowski 34f07a9995SKamil Rytarowski NativeProcessNetBSD &NativeRegisterContextNetBSD::GetProcess() { 3582abefa4SPavel Labath return static_cast<NativeProcessNetBSD &>(m_thread.GetProcess()); 36f07a9995SKamil Rytarowski } 37f07a9995SKamil Rytarowski 38f07a9995SKamil Rytarowski ::pid_t NativeRegisterContextNetBSD::GetProcessPid() { 3982abefa4SPavel Labath return GetProcess().GetID(); 40f07a9995SKamil Rytarowski } 41