LLVM 23.0.0git
GsymReaderV2.h
Go to the documentation of this file.
1//===- GsymReaderV2.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 LLVM_DEBUGINFO_GSYM_GSYMREADERV2_H
10#define LLVM_DEBUGINFO_GSYM_GSYMREADERV2_H
11
14
15namespace llvm {
16class MemoryBuffer;
17
18namespace gsym {
19
20/// GsymReaderV2 reads GSYM V2 data from a buffer.
21class GsymReaderV2 : public GsymReader {
22 friend class GsymReader;
23 const HeaderV2 *Hdr = nullptr;
24 std::unique_ptr<HeaderV2> SwappedHdr;
25
26protected:
27 GsymReaderV2(std::unique_ptr<MemoryBuffer> Buffer, llvm::endianness Endian);
29
30public:
32 ~GsymReaderV2() override = default;
33
34 // Header accessors
35 uint16_t getVersion() const override { return HeaderV2::getVersion(); }
36 uint64_t getBaseAddress() const override { return Hdr->BaseAddress; }
37 uint64_t getNumAddresses() const override { return Hdr->NumAddresses; }
38 uint8_t getAddressOffsetSize() const override { return Hdr->AddrOffSize; }
42 uint8_t getStringOffsetSize() const override {
44 }
45
46 using GsymReader::dump;
47 LLVM_ABI void dump(raw_ostream &OS) override;
48};
49
50} // namespace gsym
51} // namespace llvm
52
53#endif // LLVM_DEBUGINFO_GSYM_GSYMREADERV2_H
#define LLVM_ABI
Definition Compiler.h:213
Value * RHS
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
This interface provides simple read-only access to a block of memory, and provides simple methods for...
uint16_t getVersion() const override
Get the GSYM version for this reader.
uint64_t getNumAddresses() const override
Get the number of addresses in this GSYM file.
GsymReaderV2(GsymReaderV2 &&RHS)=default
GsymReaderV2(std::unique_ptr< MemoryBuffer > Buffer, llvm::endianness Endian)
uint64_t getBaseAddress() const override
Get the base address of this GSYM file.
uint8_t getAddressInfoOffsetSize() const override
Get the address info offset byte size for this GSYM file.
uint8_t getAddressOffsetSize() const override
Get the address offset byte size for this GSYM file.
~GsymReaderV2() override=default
uint8_t getStringOffsetSize() const override
Get the string offset byte size for this GSYM file.
LLVM_ABI void dump(raw_ostream &OS) override
Dump the entire Gsym data contained in this object.
llvm::Error parseHeaderAndGlobalDataEntries() override
For V2 file layout, see HeaderV2.h.
virtual void dump(raw_ostream &OS)=0
Dump the entire Gsym data contained in this object.
llvm::endianness Endian
Definition GsymReader.h:51
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
endianness
Definition bit.h:71
The GSYM V2 header.
Definition HeaderV2.h:60
static constexpr uint32_t getVersion()
Return the version of this header.
Definition HeaderV2.h:83
static constexpr uint8_t getAddressInfoOffsetSize()
Return the size in bytes of address info offsets.
Definition HeaderV2.h:90
static constexpr uint8_t getStringOffsetSize()
Return the size in bytes of string table offsets.
Definition HeaderV2.h:93