LLDB mainline
RegisterContextPOSIXCore_s390x.cpp
Go to the documentation of this file.
1//===-- RegisterContextPOSIXCore_s390x.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"
14
15#include <memory>
16
17using namespace lldb_private;
18
20 Thread &thread, RegisterInfoInterface *register_info,
21 const DataExtractor &gpregset, llvm::ArrayRef<CoreNote> notes)
22 : RegisterContextPOSIX_s390x(thread, 0, register_info) {
23 m_gpr_buffer = std::make_shared<DataBufferHeap>(gpregset.GetDataStart(),
24 gpregset.GetByteSize());
27
28 DataExtractor fpregset = getRegset(
29 notes, register_info->GetTargetArchitecture().GetTriple(), FPR_Desc);
30 m_fpr_buffer = std::make_shared<DataBufferHeap>(fpregset.GetDataStart(),
31 fpregset.GetByteSize());
34}
35
37
39
41
43 assert(0);
44 return false;
45}
46
48 assert(0);
49 return false;
50}
51
53 RegisterValue &value) {
54 const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
55 if (reg == LLDB_INVALID_REGNUM)
56 return false;
57
58 if (IsGPR(reg)) {
59 lldb::offset_t offset = reg_info->byte_offset;
60 uint64_t v = m_gpr.GetMaxU64(&offset, reg_info->byte_size);
61 if (offset == reg_info->byte_offset + reg_info->byte_size) {
62 value.SetUInt(v, reg_info->byte_size);
63 return true;
64 }
65 }
66
67 if (IsFPR(reg)) {
68 lldb::offset_t offset = reg_info->byte_offset;
69 uint64_t v = m_fpr.GetMaxU64(&offset, reg_info->byte_size);
70 if (offset == reg_info->byte_offset + reg_info->byte_size) {
71 value.SetUInt(v, reg_info->byte_size);
72 return true;
73 }
74 }
75
76 return false;
77}
78
81 return false;
82}
83
85 const RegisterValue &value) {
86 return false;
87}
88
90 const lldb::DataBufferSP &data_sp) {
91 return false;
92}
93
95 return false;
96}
bool WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override
bool ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp) override
RegisterContextCorePOSIX_s390x(lldb_private::Thread &thread, lldb_private::RegisterInfoInterface *register_info, const lldb_private::DataExtractor &gpregset, llvm::ArrayRef< lldb_private::CoreNote > notes)
bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
bool WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
~RegisterContextCorePOSIX_s390x() override
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:450
An data extractor class.
Definition: DataExtractor.h:48
void SetByteOrder(lldb::ByteOrder byte_order)
Set the byte_order value.
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
const uint8_t * GetDataStart() const
Get the data start pointer.
lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order)
Set data with a buffer that is caller owned.
uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const
Extract an unsigned integer of size byte_size from *offset_ptr.
lldb::ByteOrder GetByteOrder() const
Get the current byte order value.
RegisterInfo interface to patch RegisterInfo structure for archs.
const lldb_private::ArchSpec & GetTargetArchitecture() const
bool SetUInt(uint64_t uint, uint32_t byte_size)
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:87
A class that represents a running process on the host machine.
DataExtractor getRegset(llvm::ArrayRef< CoreNote > Notes, const llvm::Triple &Triple, llvm::ArrayRef< RegsetDesc > RegsetDescs)
constexpr RegsetDesc FPR_Desc[]
uint64_t offset_t
Definition: lldb-types.h:85
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
Definition: lldb-forward.h:334
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Definition: lldb-forward.h:335
@ eRegisterKindLLDB
lldb's internal register numbers
Every register is described in detail including its name, alternate name (optional),...
uint32_t byte_offset
The byte offset in the register context data where this register's value is found.
uint32_t byte_size
Size in bytes of the register.
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.