LLDB mainline
Functions | Variables
ObjectFileWasm.cpp File Reference
#include "ObjectFileWasm.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/BinaryFormat/Wasm.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Format.h"
#include <optional>

Go to the source code of this file.

Functions

static bool ValidateModuleHeader (const DataBufferSP &data_sp)
 Checks whether the data buffer starts with a valid Wasm module header.
 
static std::optional< ConstStringGetWasmString (llvm::DataExtractor &data, llvm::DataExtractor::Cursor &c)
 
static SectionType GetSectionTypeFromName (llvm::StringRef Name)
 

Variables

static const uint32_t kWasmHeaderSize
 

Function Documentation

◆ GetSectionTypeFromName()

static SectionType GetSectionTypeFromName ( llvm::StringRef  Name)
static

◆ GetWasmString()

static std::optional< ConstString > GetWasmString ( llvm::DataExtractor &  data,
llvm::DataExtractor::Cursor &  c 
)
static

◆ ValidateModuleHeader()

static bool ValidateModuleHeader ( const DataBufferSP data_sp)
static

Checks whether the data buffer starts with a valid Wasm module header.

Definition at line 39 of file ObjectFileWasm.cpp.

References kWasmHeaderSize.

Referenced by lldb_private::wasm::ObjectFileWasm::CreateInstance(), lldb_private::wasm::ObjectFileWasm::CreateMemoryInstance(), and lldb_private::wasm::ObjectFileWasm::GetModuleSpecifications().

Variable Documentation

◆ kWasmHeaderSize

const uint32_t kWasmHeaderSize
static
Initial value:
=
sizeof(llvm::wasm::WasmMagic) + sizeof(llvm::wasm::WasmVersion)

Definition at line 35 of file ObjectFileWasm.cpp.

Referenced by lldb_private::wasm::ObjectFileWasm::DecodeSections(), and ValidateModuleHeader().