LLVM 23.0.0git
GsymReaderV1.h
Go to the documentation of this file.
1//===- GsymReaderV1.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_GSYMREADERV1_H
10#define LLVM_DEBUGINFO_GSYM_GSYMREADERV1_H
11
14
15namespace llvm {
16class MemoryBuffer;
17
18namespace gsym {
19
20/// GsymReaderV1 reads GSYM V1 data from a buffer.
21class GsymReaderV1 : public GsymReader {
22 friend class GsymReader;
23 const Header *Hdr = nullptr;
24 std::unique_ptr<Header> SwappedHdr;
25
26protected:
27 GsymReaderV1(std::unique_ptr<MemoryBuffer> Buffer, llvm::endianness Endian);
29
30public:
32 ~GsymReaderV1() override = default;
33
34 // Header accessors
35 uint16_t getVersion() const override { return Header::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_GSYMREADERV1_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...
uint8_t getAddressOffsetSize() const override
Get the address offset byte size for this GSYM file.
uint64_t getBaseAddress() const override
Get the base address of this GSYM file.
uint8_t getStringOffsetSize() const override
Get the string offset byte size for this GSYM file.
llvm::Error parseHeaderAndGlobalDataEntries() override
Parse the version-specific header and populate GlobalDataSections.
uint64_t getNumAddresses() const override
Get the number of addresses in this GSYM file.
uint16_t getVersion() const override
Get the GSYM version for this reader.
~GsymReaderV1() override=default
uint8_t getAddressInfoOffsetSize() const override
Get the address info offset byte size for this GSYM file.
LLVM_ABI void dump(raw_ostream &OS) override
Dump the entire Gsym data contained in this object.
GsymReaderV1(std::unique_ptr< MemoryBuffer > Buffer, llvm::endianness Endian)
GsymReaderV1(GsymReaderV1 &&RHS)=default
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 header.
Definition Header.h:45
static constexpr uint32_t getVersion()
Return the version of this header.
Definition Header.h:89
static constexpr uint8_t getStringOffsetSize()
Return the size in bytes of string table offsets.
Definition Header.h:98
static constexpr uint8_t getAddressInfoOffsetSize()
Return the size in bytes of address info offsets.
Definition Header.h:95