Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / source / Plugins / Process / elf-core / RegisterContextPOSIXCore_arm.cpp
blob3a62081827c6ad89a6ee445887a2efa8b5498bea
1 //===-- RegisterContextPOSIXCore_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 //===----------------------------------------------------------------------===//
9 #include "RegisterContextPOSIXCore_arm.h"
11 #include "lldb/Target/Thread.h"
12 #include "lldb/Utility/RegisterValue.h"
14 #include <memory>
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() {
35 assert(0);
36 return false;
39 bool RegisterContextCorePOSIX_arm::WriteFPR() {
40 assert(0);
41 return false;
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) {
50 value = v;
51 return true;
54 return false;
57 bool RegisterContextCorePOSIX_arm::ReadAllRegisterValues(
58 lldb::WritableDataBufferSP &data_sp) {
59 return false;
62 bool RegisterContextCorePOSIX_arm::WriteRegister(const RegisterInfo *reg_info,
63 const RegisterValue &value) {
64 return false;
67 bool RegisterContextCorePOSIX_arm::WriteAllRegisterValues(
68 const lldb::DataBufferSP &data_sp) {
69 return false;
72 bool RegisterContextCorePOSIX_arm::HardwareSingleStep(bool enable) {
73 return false;