1+ // ===-- NativeRegisterContextLinux_arm64dbreg.cpp -------------------------===//
2+ //
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
6+ //
7+ // ===----------------------------------------------------------------------===//
8+
19#include " NativeRegisterContextLinux_arm64dbreg.h"
10+ #include " lldb/Host/linux/Ptrace.h"
211
3- using namespace lldb_private ::process_linux::arm64;
12+ #include < asm/ptrace.h>
13+ // System includes - They have to be included after framework includes because
14+ // they define some macros which collide with variable names in other modules
15+ #include < sys/uio.h>
16+ // NT_PRSTATUS and NT_FPREGSET definition
17+ #include < elf.h>
418
5- namespace lldb_private {
6- namespace process_linux {
7- namespace arm64 {
19+ using namespace lldb ;
20+ using namespace lldb_private ;
21+ using namespace lldb_private ::process_linux ;
822
9- namespace {
10- Status ReadHardwareDebugInfoHelper (int regset, ::pid_t tid,
11- uint32_t &max_supported) {
23+ static Status ReadHardwareDebugInfoHelper (int regset, ::pid_t tid,
24+ uint32_t &max_supported) {
1225 struct iovec ioVec;
1326 struct user_hwdebug_state dreg_state;
1427 Status error;
@@ -24,10 +37,9 @@ Status ReadHardwareDebugInfoHelper(int regset, ::pid_t tid,
2437 max_supported = dreg_state.dbg_info & 0xff ;
2538 return error;
2639}
27- } // namespace
2840
29- Status ReadHardwareDebugInfo (:: pid_t tid, uint32_t &max_hwp_supported,
30- uint32_t &max_hbp_supported) {
41+ Status lldb_private::process_linux::arm64::ReadHardwareDebugInfo (
42+ :: pid_t tid, uint32_t &max_hwp_supported, uint32_t &max_hbp_supported) {
3143 Status error =
3244 ReadHardwareDebugInfoHelper (NT_ARM_HW_WATCH, tid, max_hwp_supported);
3345
@@ -37,7 +49,7 @@ Status ReadHardwareDebugInfo(::pid_t tid, uint32_t &max_hwp_supported,
3749 return ReadHardwareDebugInfoHelper (NT_ARM_HW_BREAK, tid, max_hbp_supported);
3850}
3951
40- Status WriteHardwareDebugRegs (
52+ Status lldb_private::process_linux::arm64:: WriteHardwareDebugRegs (
4153 int hwbType, ::pid_t tid, uint32_t max_supported,
4254 const std::array<NativeRegisterContextDBReg::DREG, 16 > ®s) {
4355 struct iovec ioVec;
@@ -57,7 +69,3 @@ Status WriteHardwareDebugRegs(
5769 return NativeProcessLinux::PtraceWrapper (PTRACE_SETREGSET, tid, ®set,
5870 &ioVec, ioVec.iov_len );
5971}
60-
61- } // namespace arm64
62- } // namespace process_linux
63- } // namespace lldb_private
0 commit comments