Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
nm_debug_info Struct Reference

Public Types

using builder = nm_debug_info
 

Public Member Functions

void on_code_start (const void *compiled_base, const void *wasm_code_start)
 
void on_function_start (const void *code_addr, const void *wasm_addr)
 
void on_instr_start (const void *code_addr, const void *wasm_addr)
 
void on_code_end (const void *code_addr, const void *wasm_addr)
 
void set (nm_debug_info &&other)
 
void relocate (const void *)
 
uint32_t get_function (std::uint32_t addr)
 

Public Attributes

const void * wasm_base
 
std::vector< uint32_tfunction_offsets
 

Detailed Description

Definition at line 6 of file addr2line.cpp.

Member Typedef Documentation

◆ builder

Definition at line 7 of file addr2line.cpp.

Member Function Documentation

◆ get_function()

uint32_t nm_debug_info::get_function ( std::uint32_t addr)
inline

Definition at line 19 of file addr2line.cpp.

19 {
20 auto pos = std::lower_bound(function_offsets.begin(), function_offsets.end(), addr + 1);
21 if(pos == function_offsets.begin()) return 0;
22 return (pos - function_offsets.begin()) - 1;
23 }
std::vector< uint32_t > function_offsets
Definition addr2line.cpp:26

◆ on_code_end()

void nm_debug_info::on_code_end ( const void * code_addr,
const void * wasm_addr )
inline

Definition at line 15 of file addr2line.cpp.

15{}

◆ on_code_start()

void nm_debug_info::on_code_start ( const void * compiled_base,
const void * wasm_code_start )
inline

Definition at line 8 of file addr2line.cpp.

8 {
9 wasm_base = wasm_code_start;
10 }
const void * wasm_base
Definition addr2line.cpp:25

◆ on_function_start()

void nm_debug_info::on_function_start ( const void * code_addr,
const void * wasm_addr )
inline

Definition at line 11 of file addr2line.cpp.

11 {
12 function_offsets.push_back(static_cast<std::uint32_t>(reinterpret_cast<const char*>(wasm_addr) - reinterpret_cast<const char*>(wasm_base)));
13 }

◆ on_instr_start()

void nm_debug_info::on_instr_start ( const void * code_addr,
const void * wasm_addr )
inline

Definition at line 14 of file addr2line.cpp.

14{}

◆ relocate()

void nm_debug_info::relocate ( const void * )
inline

Definition at line 17 of file addr2line.cpp.

17{}

◆ set()

void nm_debug_info::set ( nm_debug_info && other)
inline

Definition at line 16 of file addr2line.cpp.

16{ *this = std::move(other); }

Member Data Documentation

◆ function_offsets

std::vector<uint32_t> nm_debug_info::function_offsets

Definition at line 26 of file addr2line.cpp.

◆ wasm_base

const void* nm_debug_info::wasm_base

Definition at line 25 of file addr2line.cpp.


The documentation for this struct was generated from the following file: