Function getSymbol [src]

Prototype

pub fn getSymbol(di: *Dwarf, allocator: Allocator, address: u64) !std.debug.Symbol

Parameters

di: *Dwarfallocator: Allocatoraddress: u64

Source

pub fn getSymbol(di: *Dwarf, allocator: Allocator, address: u64) !std.debug.Symbol { if (di.findCompileUnit(address)) |compile_unit| { return .{ .name = di.getSymbolName(address) orelse "???", .compile_unit_name = compile_unit.die.getAttrString(di, std.dwarf.AT.name, di.section(.debug_str), compile_unit.*) catch |err| switch (err) { error.MissingDebugInfo, error.InvalidDebugInfo => "???", }, .source_location = di.getLineNumberInfo(allocator, compile_unit, address) catch |err| switch (err) { error.MissingDebugInfo, error.InvalidDebugInfo => null, else => return err, }, }; } else |err| switch (err) { error.MissingDebugInfo, error.InvalidDebugInfo => return .{}, else => return err, } }