LLDB  mainline
RegisterContextPOSIXCore_arm.cpp
Go to the documentation of this file.
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 //===----------------------------------------------------------------------===//
8 
10 
11 #include "lldb/Target/Thread.h"
13 
14 #include <memory>
15 
16 using namespace lldb_private;
17 
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());
25  m_gpr.SetByteOrder(gpregset.GetByteOrder());
26 }
27 
29 
31 
32 bool RegisterContextCorePOSIX_arm::ReadFPR() { return false; }
33 
35  assert(0);
36  return false;
37 }
38 
40  assert(0);
41  return false;
42 }
43 
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;
52  }
53  }
54  return false;
55 }
56 
58  lldb::DataBufferSP &data_sp) {
59  return false;
60 }
61 
62 bool RegisterContextCorePOSIX_arm::WriteRegister(const RegisterInfo *reg_info,
63  const RegisterValue &value) {
64  return false;
65 }
66 
68  const lldb::DataBufferSP &data_sp) {
69  return false;
70 }
71 
73  return false;
74 }
RegisterContextCorePOSIX_arm::ReadAllRegisterValues
bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override
Definition: RegisterContextPOSIXCore_arm.cpp:57
RegisterContextCorePOSIX_arm::WriteAllRegisterValues
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
Definition: RegisterContextPOSIXCore_arm.cpp:67
lldb_private::RegisterValue
Definition: RegisterValue.h:28
RegisterContextCorePOSIX_arm::ReadGPR
bool ReadGPR() override
Definition: RegisterContextPOSIXCore_arm.cpp:30
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
RegisterValue.h
RegisterContextCorePOSIX_arm::m_gpr
lldb_private::DataExtractor m_gpr
Definition: RegisterContextPOSIXCore_arm.h:50
lldb_private::DataExtractor::SetData
lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order)
Set data with a buffer that is caller owned.
Definition: DataExtractor.cpp:225
RegisterContextPOSIXCore_arm.h
RegisterContextPOSIX_arm::GetGPRSize
virtual size_t GetGPRSize()
Definition: RegisterContextPOSIX_arm.cpp:66
lldb_private::DataExtractor::SetByteOrder
void SetByteOrder(lldb::ByteOrder byte_order)
Set the byte_order value.
Definition: DataExtractor.h:931
RegisterContextPOSIX_arm
Definition: RegisterContextPOSIX_arm.h:17
RegisterContextCorePOSIX_arm::WriteGPR
bool WriteGPR() override
Definition: RegisterContextPOSIXCore_arm.cpp:34
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::Thread
Definition: Thread.h:60
RegisterContextCorePOSIX_arm::m_gpr_buffer
lldb::DataBufferSP m_gpr_buffer
Definition: RegisterContextPOSIXCore_arm.h:49
RegisterContextCorePOSIX_arm::ReadRegister
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
Definition: RegisterContextPOSIXCore_arm.cpp:44
lldb_private::DataExtractor::GetDataStart
const uint8_t * GetDataStart() const
Get the data start pointer.
Definition: DataExtractor.h:422
lldb_private::DataExtractor::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Get the current byte order value.
Definition: DataExtractor.h:594
Thread.h
RegisterContextCorePOSIX_arm::ReadFPR
bool ReadFPR() override
Definition: RegisterContextPOSIXCore_arm.cpp:32
lldb_private::DataExtractor::GetMaxU64
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
Definition: DataExtractor.cpp:526
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
RegisterContextCorePOSIX_arm::HardwareSingleStep
bool HardwareSingleStep(bool enable) override
Definition: RegisterContextPOSIXCore_arm.cpp:72
RegisterContextCorePOSIX_arm::RegisterContextCorePOSIX_arm
RegisterContextCorePOSIX_arm(lldb_private::Thread &thread, std::unique_ptr< RegisterInfoPOSIX_arm > register_info, const lldb_private::DataExtractor &gpregset, llvm::ArrayRef< lldb_private::CoreNote > notes)
Definition: RegisterContextPOSIXCore_arm.cpp:18
RegisterContextCorePOSIX_arm::WriteRegister
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
Definition: RegisterContextPOSIXCore_arm.cpp:62
lldb_private::DataExtractor::GetByteSize
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
Definition: DataExtractor.h:270
RegisterContextCorePOSIX_arm::WriteFPR
bool WriteFPR() override
Definition: RegisterContextPOSIXCore_arm.cpp:39
RegisterContextCorePOSIX_arm::~RegisterContextCorePOSIX_arm
~RegisterContextCorePOSIX_arm() override