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

getSymbolName

Public Function
std.debug.Dwarf.getSymbolName
pub fn getSymbolName(di: *const Dwarf, address: u64) ?[]const u8

Params

  • di: *const Dwarf
  • address: u64

File

debug/Dwarf.zig:345
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
pub fn getSymbolName(di: *const Dwarf, address: u64) ?[]const u8 {
    // Iterate the function list backwards so that we see child DIEs before their parents. This is
    // important because `DW_TAG_inlined_subroutine` DIEs will have a range which is a sub-range of
    // their caller, and we want to return the callee's name, not the caller's.
    var i: usize = di.func_list.items.len;
    while (i > 0) {
        i -= 1;
        const func = &di.func_list.items[i];
        if (func.pc_range) |range| {
            if (address >= range.start and address < range.end) {
                return func.name;
            }
        }
    }

    return null;
}