LLDB mainline
RegisterContextPOSIX_arm.cpp
Go to the documentation of this file.
1//===-- RegisterContextPOSIX_arm.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
9#include <cerrno>
10#include <cstdint>
11#include <cstring>
12
13#include "lldb/Target/Process.h"
14#include "lldb/Target/Target.h"
15#include "lldb/Target/Thread.h"
18#include "lldb/Utility/Endian.h"
20#include "lldb/Utility/Scalar.h"
21#include "llvm/Support/Compiler.h"
22
24
25using namespace lldb;
26using namespace lldb_private;
27
29 if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
31 return true;
32 return false;
33}
34
36 if (m_register_info_up->GetRegisterSetFromRegisterIndex(reg) ==
38 return true;
39 return false;
40}
41
44 std::unique_ptr<RegisterInfoPOSIX_arm> register_info)
45 : lldb_private::RegisterContext(thread, 0),
46 m_register_info_up(std::move(register_info)) {}
47
49
51
53
55 return m_register_info_up->GetRegisterInfo()[reg].byte_offset;
56}
57
59 return m_register_info_up->GetRegisterInfo()[reg].byte_size;
60}
61
63 return m_register_info_up->GetRegisterCount();
64}
65
67 return m_register_info_up->GetGPRSize();
68}
69
71 // Commonly, this method is overridden and g_register_infos is copied and
72 // specialized. So, use GetRegisterInfo() rather than g_register_infos in
73 // this scope.
74 return m_register_info_up->GetRegisterInfo();
75}
76
79 if (reg < GetRegisterCount())
80 return &GetRegisterInfo()[reg];
81
82 return nullptr;
83}
84
86 return m_register_info_up->GetRegisterSetCount();
87}
88
91 return m_register_info_up->GetRegisterSet(set);
92}
93
95 if (reg < GetRegisterCount())
96 return GetRegisterInfo()[reg].name;
97 return nullptr;
98}
virtual unsigned GetRegisterOffset(unsigned reg)
const lldb_private::RegisterInfo * GetRegisterInfoAtIndex(size_t reg) override
RegisterContextPOSIX_arm(lldb_private::Thread &thread, std::unique_ptr< RegisterInfoPOSIX_arm > register_info)
const char * GetRegisterName(unsigned reg)
const lldb_private::RegisterSet * GetRegisterSet(size_t set) override
std::unique_ptr< RegisterInfoPOSIX_arm > m_register_info_up
virtual unsigned GetRegisterSize(unsigned reg)
~RegisterContextPOSIX_arm() override
virtual const lldb_private::RegisterInfo * GetRegisterInfo()
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
Every register is described in detail including its name, alternate name (optional),...
const char * name
Name of this register, can't be NULL.
Registers are grouped into register sets.