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 Struct

DebugInfoSearchPaths

Public Struct
std.debug.ElfFile.DebugInfoSearchPaths
pub const DebugInfoSearchPaths = struct

Fields

debuginfod_client: ?[2][]const u8

The location of a debuginfod client directory, which acts as a search path for build IDs. If given, we can load from this directory opportunistically, but make no effort to populate it. To avoid allocation when building the search paths, this is given as two components which will be concatenated.

global_debug: []const []const u8

All "global debug directories" on the system. These are used as search paths for both debug links and build IDs. On typical systems this is just "/usr/lib/debug".

exe_dir: ?[]const u8

The path to the dirname of the ELF file, which acts as a search path for debug links.

Values

Functions

pub fn native(exe_path: []const u8) DebugInfoSearchPaths

File

debug/ElfFile.zig:51
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pub const DebugInfoSearchPaths = struct {
    /// The location of a debuginfod client directory, which acts as a search path for build IDs. If
    /// given, we can load from this directory opportunistically, but make no effort to populate it.
    /// To avoid allocation when building the search paths, this is given as two components which
    /// will be concatenated.
    debuginfod_client: ?[2][]const u8,
    /// All "global debug directories" on the system. These are used as search paths for both debug
    /// links and build IDs. On typical systems this is just "/usr/lib/debug".
    global_debug: []const []const u8,
    /// The path to the dirname of the ELF file, which acts as a search path for debug links.
    exe_dir: ?[]const u8,

    pub const none: DebugInfoSearchPaths = .{
        .debuginfod_client = null,
        .global_debug = &.{},
        .exe_dir = null,
    };

    pub fn native(exe_path: []const u8) DebugInfoSearchPaths {
        if (std.Options.elf_debug_info_search_paths) |f| return f(exe_path);
        if (std.Options.debug_threaded_io) |t| return .{
            .debuginfod_client = p: {
                if (t.environString("DEBUGINFOD_CACHE_PATH")) |p| {
                    break :p .{ p, "" };
                }
                if (t.environString("XDG_CACHE_HOME")) |cache_path| {
                    break :p .{ cache_path, "/debuginfod_client" };
                }
                if (t.environString("HOME")) |home_path| {
                    break :p .{ home_path, "/.cache/debuginfod_client" };
                }
                break :p null;
            },
            .global_debug = &.{
                "/usr/lib/debug",
            },
            .exe_dir = std.fs.path.dirname(exe_path) orelse ".",
        };
        @compileError("std.Options.elf_debug_info_search_paths must be provided");
    }
}