Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

getSymbols

Public Function
std.debug.Dwarf.getSymbols
pub fn getSymbols(
    di: *Dwarf,
    symbol_allocator: Allocator,
    text_arena: Allocator,
    endian: Endian,
    address: u64,
    resolve_inline_callers: bool,
    symbols: *std.ArrayList(std.debug.Symbol),
) std.debug.SelfInfoError!void

Params

File

debug/Dwarf.zig:1638
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
pub fn getSymbols(
    di: *Dwarf,
    symbol_allocator: Allocator,
    text_arena: Allocator,
    endian: Endian,
    address: u64,
    resolve_inline_callers: bool,
    symbols: *std.ArrayList(std.debug.Symbol),
) std.debug.SelfInfoError!void {
    _ = resolve_inline_callers;
    const gpa = std.debug.getDebugInfoAllocator();

    const compile_unit = di.findCompileUnit(endian, address) catch |err| switch (err) {
        error.EndOfStream => return error.MissingDebugInfo,
        error.Overflow => return error.InvalidDebugInfo,
        error.ReadFailed, error.InvalidDebugInfo, error.MissingDebugInfo => |e| return e,
    };
    try symbols.append(symbol_allocator, .{
        .name = di.getSymbolName(address),
        .compile_unit_name = compile_unit.die.getAttrString(di, endian, std.dwarf.AT.name, di.section(.debug_str), compile_unit) catch |err| switch (err) {
            error.MissingDebugInfo, error.InvalidDebugInfo => null,
        },
        .source_location = di.getLineNumberInfo(gpa, text_arena, endian, compile_unit, address) catch |err| switch (err) {
            error.MissingDebugInfo, error.InvalidDebugInfo => null,
            error.ReadFailed,
            error.EndOfStream,
            error.Overflow,
            error.StreamTooLong,
            => return error.InvalidDebugInfo,
            else => |e| return e,
        },
    });
}