LLDB  mainline
MemoryTagManagerAArch64MTE.h
Go to the documentation of this file.
1 //===-- MemoryTagManagerAArch64MTE.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_UTILITY_MEMORYTAGMANAGERAARCH64MTE_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_MEMORYTAGMANAGERAARCH64MTE_H
11 
13 
14 namespace lldb_private {
15 
17 public:
18  // This enum is supposed to be shared for all of AArch64 but until
19  // there are more tag types than MTE, it will live here.
20  enum MTETagTypes {
23  };
24 
25  lldb::addr_t GetGranuleSize() const override;
26  int32_t GetAllocationTagType() const override;
27  size_t GetTagSizeInBytes() const override;
28 
29  lldb::addr_t GetLogicalTag(lldb::addr_t addr) const override;
30  lldb::addr_t RemoveTagBits(lldb::addr_t addr) const override;
31  ptrdiff_t AddressDiff(lldb::addr_t addr1, lldb::addr_t addr2) const override;
32 
33  TagRange ExpandToGranule(TagRange range) const override;
34 
35  llvm::Expected<TagRange> MakeTaggedRange(
36  lldb::addr_t addr, lldb::addr_t end_addr,
37  const lldb_private::MemoryRegionInfos &memory_regions) const override;
38 
39  llvm::Expected<std::vector<TagRange>> MakeTaggedRanges(
40  lldb::addr_t addr, lldb::addr_t end_addr,
41  const lldb_private::MemoryRegionInfos &memory_regions) const override;
42 
43  llvm::Expected<std::vector<lldb::addr_t>>
44  UnpackTagsData(const std::vector<uint8_t> &tags,
45  size_t granules = 0) const override;
46 
47  llvm::Expected<std::vector<uint8_t>>
48  PackTags(const std::vector<lldb::addr_t> &tags) const override;
49 
50  llvm::Expected<std::vector<lldb::addr_t>>
51  RepeatTagsForRange(const std::vector<lldb::addr_t> &tags,
52  TagRange range) const override;
53 };
54 
55 } // namespace lldb_private
56 
57 #endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_MEMORYTAGMANAGERAARCH64MTE_H
lldb_private::MemoryTagManagerAArch64MTE::PackTags
llvm::Expected< std::vector< uint8_t > > PackTags(const std::vector< lldb::addr_t > &tags) const override
Definition: MemoryTagManagerAArch64MTE.cpp:250
lldb_private::MemoryTagManagerAArch64MTE::UnpackTagsData
llvm::Expected< std::vector< lldb::addr_t > > UnpackTagsData(const std::vector< uint8_t > &tags, size_t granules=0) const override
Definition: MemoryTagManagerAArch64MTE.cpp:218
lldb_private::MemoryTagManagerAArch64MTE::GetLogicalTag
lldb::addr_t GetLogicalTag(lldb::addr_t addr) const override
Definition: MemoryTagManagerAArch64MTE.cpp:20
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::MemoryTagManagerAArch64MTE::ExpandToGranule
TagRange ExpandToGranule(TagRange range) const override
Definition: MemoryTagManagerAArch64MTE.cpp:49
lldb_private::MemoryTagManager
Definition: MemoryTagManager.h:28
lldb_private::MemoryTagManagerAArch64MTE::MTETagTypes
MTETagTypes
Definition: MemoryTagManagerAArch64MTE.h:20
lldb_private::MemoryRegionInfos
Definition: MemoryRegionInfo.h:172
lldb_private::MemoryTagManagerAArch64MTE::GetAllocationTagType
int32_t GetAllocationTagType() const override
Definition: MemoryTagManagerAArch64MTE.cpp:42
lldb_private::MemoryTagManagerAArch64MTE::RemoveTagBits
lldb::addr_t RemoveTagBits(lldb::addr_t addr) const override
Definition: MemoryTagManagerAArch64MTE.cpp:25
lldb_private::MemoryTagManagerAArch64MTE::eMTE_logical
@ eMTE_logical
Definition: MemoryTagManagerAArch64MTE.h:21
lldb_private::MemoryTagManagerAArch64MTE::MakeTaggedRange
llvm::Expected< TagRange > MakeTaggedRange(lldb::addr_t addr, lldb::addr_t end_addr, const lldb_private::MemoryRegionInfos &memory_regions) const override
Definition: MemoryTagManagerAArch64MTE.cpp:81
lldb_private::MemoryTagManagerAArch64MTE::AddressDiff
ptrdiff_t AddressDiff(lldb::addr_t addr1, lldb::addr_t addr2) const override
Definition: MemoryTagManagerAArch64MTE.cpp:33
lldb_private::MemoryTagManagerAArch64MTE::RepeatTagsForRange
llvm::Expected< std::vector< lldb::addr_t > > RepeatTagsForRange(const std::vector< lldb::addr_t > &tags, TagRange range) const override
Definition: MemoryTagManagerAArch64MTE.cpp:269
lldb_private::MemoryTagManagerAArch64MTE::eMTE_allocation
@ eMTE_allocation
Definition: MemoryTagManagerAArch64MTE.h:22
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::MemoryTagManagerAArch64MTE::GetTagSizeInBytes
size_t GetTagSizeInBytes() const override
Definition: MemoryTagManagerAArch64MTE.cpp:46
lldb_private::MemoryTagManagerAArch64MTE
Definition: MemoryTagManagerAArch64MTE.h:16
MemoryTagManager.h
lldb_private::MemoryTagManagerAArch64MTE::GetGranuleSize
lldb::addr_t GetGranuleSize() const override
Definition: MemoryTagManagerAArch64MTE.cpp:38
lldb_private::MemoryTagManagerAArch64MTE::MakeTaggedRanges
llvm::Expected< std::vector< TagRange > > MakeTaggedRanges(lldb::addr_t addr, lldb::addr_t end_addr, const lldb_private::MemoryRegionInfos &memory_regions) const override
Definition: MemoryTagManagerAArch64MTE.cpp:133
lldb_private::MemoryTagManager::TagRange
Range< lldb::addr_t, lldb::addr_t > TagRange
Definition: MemoryTagManager.h:30