1 //===-- NativeRegisterContextNetBSD.cpp -------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "NativeRegisterContextNetBSD.h"
11 #include "lldb/Host/common/NativeProcessProtocol.h"
13 using namespace lldb_private;
14 using namespace lldb_private::process_netbsd;
17 #include <sys/types.h>
18 #include <sys/ptrace.h>
21 NativeRegisterContextNetBSD::NativeRegisterContextNetBSD(
22 NativeThreadProtocol &native_thread,
23 RegisterInfoInterface *reg_info_interface_p)
24 : NativeRegisterContextRegisterInfo(native_thread,
25 reg_info_interface_p) {}
27 Status NativeRegisterContextNetBSD::DoRegisterSet(int ptrace_req, void *buf) {
28 return NativeProcessNetBSD::PtraceWrapper(ptrace_req, GetProcessPid(), buf,
32 NativeProcessNetBSD &NativeRegisterContextNetBSD::GetProcess() {
33 return static_cast<NativeProcessNetBSD &>(m_thread.GetProcess());
36 ::pid_t NativeRegisterContextNetBSD::GetProcessPid() {
37 return GetProcess().GetID();