1 //===-- RegisterContextPOSIXCore_arm.cpp ----------------------------------===//
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 "RegisterContextPOSIXCore_arm.h"
11 #include "lldb/Target/Thread.h"
12 #include "lldb/Utility/RegisterValue.h"
16 using namespace lldb_private
;
18 RegisterContextCorePOSIX_arm::RegisterContextCorePOSIX_arm(
19 Thread
&thread
, std::unique_ptr
<RegisterInfoPOSIX_arm
> register_info
,
20 const DataExtractor
&gpregset
, llvm::ArrayRef
<CoreNote
> notes
)
21 : RegisterContextPOSIX_arm(thread
, std::move(register_info
)) {
22 m_gpr_buffer
= std::make_shared
<DataBufferHeap
>(gpregset
.GetDataStart(),
23 gpregset
.GetByteSize());
24 m_gpr
.SetData(m_gpr_buffer
);
25 m_gpr
.SetByteOrder(gpregset
.GetByteOrder());
28 RegisterContextCorePOSIX_arm::~RegisterContextCorePOSIX_arm() = default;
30 bool RegisterContextCorePOSIX_arm::ReadGPR() { return true; }
32 bool RegisterContextCorePOSIX_arm::ReadFPR() { return false; }
34 bool RegisterContextCorePOSIX_arm::WriteGPR() {
39 bool RegisterContextCorePOSIX_arm::WriteFPR() {
44 bool RegisterContextCorePOSIX_arm::ReadRegister(const RegisterInfo
*reg_info
,
45 RegisterValue
&value
) {
46 lldb::offset_t offset
= reg_info
->byte_offset
;
47 if (offset
+ reg_info
->byte_size
<= GetGPRSize()) {
48 uint64_t v
= m_gpr
.GetMaxU64(&offset
, reg_info
->byte_size
);
49 if (offset
== reg_info
->byte_offset
+ reg_info
->byte_size
) {
57 bool RegisterContextCorePOSIX_arm::ReadAllRegisterValues(
58 lldb::WritableDataBufferSP
&data_sp
) {
62 bool RegisterContextCorePOSIX_arm::WriteRegister(const RegisterInfo
*reg_info
,
63 const RegisterValue
&value
) {
67 bool RegisterContextCorePOSIX_arm::WriteAllRegisterValues(
68 const lldb::DataBufferSP
&data_sp
) {
72 bool RegisterContextCorePOSIX_arm::HardwareSingleStep(bool enable
) {