LLVM 24.0.0git
GsymReader.cpp File Reference
#include "llvm/DebugInfo/GSYM/GsymReader.h"
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include "llvm/ADT/StringExtras.h"
#include "llvm/DebugInfo/GSYM/GsymReaderV1.h"
#include "llvm/DebugInfo/GSYM/GsymReaderV2.h"
#include "llvm/DebugInfo/GSYM/Header.h"
#include "llvm/DebugInfo/GSYM/HeaderV2.h"
#include "llvm/DebugInfo/GSYM/InlineInfo.h"
#include "llvm/DebugInfo/GSYM/LineTable.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/MemoryBuffer.h"

Go to the source code of this file.

Functions

static Expected< std::pair< uint16_t, llvm::endianness > > checkMagicAndDetectVersionEndian (StringRef Bytes)
 Check magic bytes, determine endianness, and return the GSYM version and endianness.
static std::string formatGsymUUID (StringRef Bytes)
 Format raw UUID bytes as a hex string, using the canonical 8-4-4-4-12 dashed layout for the common 16-byte UUID and plain hex otherwise.

Function Documentation

◆ checkMagicAndDetectVersionEndian()

Expected< std::pair< uint16_t, llvm::endianness > > checkMagicAndDetectVersionEndian ( StringRef Bytes)
static

Check magic bytes, determine endianness, and return the GSYM version and endianness.

If magic bytes are invalid, return error.

Definition at line 38 of file GsymReader.cpp.

References llvm::big, llvm::createStringError(), llvm::Data, llvm::gsym::GSYM_CIGAM, llvm::gsym::GSYM_MAGIC, llvm::little, llvm::native, llvm::Offset, and llvm::StringRef::size().

Referenced by llvm::gsym::GsymReader::create().

◆ formatGsymUUID()

std::string formatGsymUUID ( StringRef Bytes)
static

Format raw UUID bytes as a hex string, using the canonical 8-4-4-4-12 dashed layout for the common 16-byte UUID and plain hex otherwise.

Definition at line 503 of file GsymReader.cpp.

References llvm::StringRef::size(), and llvm::toHex().

Referenced by llvm::gsym::GsymReader::dumpStatistics().