class FileWriter

Declaration

class FileWriter { /* full declaration omitted */ };

Description

A simplified binary data writer class that doesn't require targets, target definitions, architectures, or require any other optional compile time libraries to be enabled via the build process. This class needs the ability to seek to different spots in the binary stream that is produces to fixup offsets and sizes.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:29

Method Overview

Methods

FileWriter(llvm::raw_pwrite_stream& S,
           llvm::support::endianness B)

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:33

Parameters

llvm::raw_pwrite_stream& S
llvm::support::endianness B

void alignTo(size_t Align)

Description

Pad with zeroes at the current file position until the current file position matches the specified alignment.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:104

Parameters

size_t Align
An integer speciying the desired alignment. This does not need to be a power of two.

void fixup32(uint32_t Value, uint64_t Offset)

Description

Fixup a uint32_t value at the specified offset in the stream. This function will save the current file position, seek to the specified offset, overwrite the data using Value, and then restore the file position to the previous file position.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:97

Parameters

uint32_t Value
The value to write into the stream.
uint64_t Offset
The offset at which to write the Value within the stream.

llvm::raw_pwrite_stream& get_stream()

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:112

uint64_t tell()

Description

Return the current offset within the file.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:110

Returns

The unsigned offset from the start of the file of the current file position.

void writeData(llvm::ArrayRef<uint8_t> Data)

Description

Write an array of uint8_t values into the stream at the current file position.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:79

Parameters

llvm::ArrayRef<uint8_t> Data
An array of values to write into the stream.

void writeNullTerminated(llvm::StringRef Str)

Description

Write a NULL terminated C string into the stream at the current file position. The entire contents of Str will be written into the steam at the current file position and then an extra NULL termation byte will be written. It is up to the user to ensure that Str doesn't contain any NULL characters unless the additional NULL characters are desired.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:88

Parameters

llvm::StringRef Str
The value to write into the stream.

void writeSLEB(int64_t Value)

Description

Write the value into the stream encoded using signed LEB128 at the current file position.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:67

Parameters

int64_t Value
The value to write into the stream.

void writeU16(uint16_t Value)

Description

Write a single uint16_t value into the stream at the current file position. The value will be byte swapped if needed to match the byte order specified during construction.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:47

Parameters

uint16_t Value
The value to write into the stream.

void writeU32(uint32_t Value)

Description

Write a single uint32_t value into the stream at the current file position. The value will be byte swapped if needed to match the byte order specified during construction.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:54

Parameters

uint32_t Value
The value to write into the stream.

void writeU64(uint64_t Value)

Description

Write a single uint64_t value into the stream at the current file position. The value will be byte swapped if needed to match the byte order specified during construction.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:61

Parameters

uint64_t Value
The value to write into the stream.

void writeU8(uint8_t Value)

Description

Write a single uint8_t value into the stream at the current file position.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:40

Parameters

uint8_t Value
The value to write into the stream.

void writeULEB(uint64_t Value)

Description

Write the value into the stream encoded using unsigned LEB128 at the current file position.

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:73

Parameters

uint64_t Value
The value to write into the stream.

~FileWriter()

Declared at: llvm/include/llvm/DebugInfo/GSYM/FileWriter.h:35