1//===-- RegisterContextPOSIXCore_loongarch64.h -------------------*- C++-*-===//
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#ifndef LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
10#define LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
11
12#include "Plugins/Process/Utility/RegisterContextPOSIX_loongarch64.h"
13#include "Plugins/Process/Utility/RegisterInfoPOSIX_loongarch64.h"
14
15#include "Plugins/Process/elf-core/RegisterUtilities.h"
16#include "lldb/Target/Thread.h"
17#include "lldb/Utility/DataExtractor.h"
18#include "lldb/Utility/RegisterValue.h"
19
20#include <memory>
21
22class RegisterContextCorePOSIX_loongarch64
23 : public RegisterContextPOSIX_loongarch64 {
24public:
25 static std::unique_ptr<RegisterContextCorePOSIX_loongarch64>
26 Create(lldb_private::Thread &thread, const lldb_private::ArchSpec &arch,
27 const lldb_private::DataExtractor &gpregset,
28 llvm::ArrayRef<lldb_private::CoreNote> notes);
29
30 ~RegisterContextCorePOSIX_loongarch64() override;
31
32 bool ReadRegister(const lldb_private::RegisterInfo *reg_info,
33 lldb_private::RegisterValue &value) override;
34
35 bool WriteRegister(const lldb_private::RegisterInfo *reg_info,
36 const lldb_private::RegisterValue &value) override;
37
38protected:
39 RegisterContextCorePOSIX_loongarch64(
40 lldb_private::Thread &thread,
41 std::unique_ptr<RegisterInfoPOSIX_loongarch64> register_info,
42 const lldb_private::DataExtractor &gpregset,
43 llvm::ArrayRef<lldb_private::CoreNote> notes);
44
45 bool ReadGPR() override;
46
47 bool ReadFPR() override;
48
49 bool WriteGPR() override;
50
51 bool WriteFPR() override;
52
53private:
54 lldb_private::DataExtractor m_gpr;
55 lldb_private::DataExtractor m_fpr;
56};
57
58#endif // LLDB_SOURCE_PLUGINS_PROCESS_ELF_CORE_REGISTERCONTEXTPOSIXCORE_LOONGARCH64_H
59

source code of lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_loongarch64.h