Skip to content
Standard libraryZig 0.17.0Official documentation
Sourcestd/dwarf.zig

Source line 1

DWARF debugging data format.

This namespace contains unopinionated types and data definitions only. For an implementation of parsing and caching DWARF information, see std.debug.Dwarf.

std.dwarf.ACCESS

namespace

Source line 180

std.dwarf.ACCESS.private

constant

Source line 183

std.dwarf.ACCESS.protected

constant

Source line 182

std.dwarf.ACCESS.public

constant

Source line 181

std.dwarf.AT

alias

Source line 8

Alias of std.dwarf.AT

std.dwarf.ATE

alias

Source line 12

Alias of std.dwarf.ATE

std.dwarf.CC

container

Source line 140

Fields

normal = 0x1
program = 0x2
nocall = 0x3
pass_by_reference = 0x4
pass_by_value = 0x5
GNU_renesas_sh = 0x40
GNU_borland_fastcall_i386 = 0x41
BORLAND_safecall = 0xb0
BORLAND_stdcall = 0xb1
BORLAND_pascal = 0xb2
BORLAND_msfastcall = 0xb3
BORLAND_msreturn = 0xb4
BORLAND_thiscall = 0xb5
BORLAND_fastcall = 0xb6
LLVM_vectorcall = 0xc0
LLVM_Win64 = 0xc1
LLVM_X86_64SysV = 0xc2
LLVM_AAPCS = 0xc3
LLVM_AAPCS_VFP = 0xc4
LLVM_IntelOclBicc = 0xc5
LLVM_SpirFunction = 0xc6
LLVM_OpenCLKernel = 0xc7
LLVM_Swift = 0xc8
LLVM_PreserveMost = 0xc9
LLVM_PreserveAll = 0xca
LLVM_X86RegCall = 0xcb
LLVM_M68kRTD = 0xcc
LLVM_PreserveNone = 0xcd
LLVM_RISCVVectorCall = 0xce
LLVM_SwiftTail = 0xcf

std.dwarf.CC.hi_user

constant

Source line 177

std.dwarf.CC.lo_user

constant

Source line 176

std.dwarf.CFA

namespace

Source line 28

std.dwarf.CFA.@"undefined"

constant

Source line 39

std.dwarf.CFA.advance_loc

constant

Source line 29

std.dwarf.CFA.advance_loc1

constant

Source line 34

std.dwarf.CFA.advance_loc2

constant

Source line 35

std.dwarf.CFA.advance_loc4

constant

Source line 36

std.dwarf.CFA.def_cfa

constant

Source line 44

std.dwarf.CFA.def_cfa_expression

constant

Source line 49

std.dwarf.CFA.def_cfa_offset

constant

Source line 46

std.dwarf.CFA.def_cfa_offset_sf

constant

Source line 53

std.dwarf.CFA.def_cfa_register

constant

Source line 45

std.dwarf.CFA.def_cfa_sf

constant

Source line 52

std.dwarf.CFA.expression

constant

Source line 50

std.dwarf.CFA.GNU_args_size

constant

Source line 66

std.dwarf.CFA.GNU_negative_offset_extended

constant

Source line 67

std.dwarf.CFA.GNU_window_save

constant

Source line 65

std.dwarf.CFA.hi_user

constant

Source line 59

std.dwarf.CFA.lo_user

constant

Source line 58

std.dwarf.CFA.MIPS_advance_loc8

constant

Source line 62

std.dwarf.CFA.nop

constant

Source line 32

std.dwarf.CFA.offset

constant

Source line 30

std.dwarf.CFA.offset_extended

constant

Source line 37

std.dwarf.CFA.offset_extended_sf

constant

Source line 51

std.dwarf.CFA.register

constant

Source line 41

std.dwarf.CFA.remember_state

constant

Source line 42

std.dwarf.CFA.restore

constant

Source line 31

std.dwarf.CFA.restore_extended

constant

Source line 38

std.dwarf.CFA.restore_state

constant

Source line 43

std.dwarf.CFA.same_value

constant

Source line 40

std.dwarf.CFA.set_loc

constant

Source line 33

std.dwarf.CFA.val_expression

constant

Source line 56

std.dwarf.CFA.val_offset

constant

Source line 54

std.dwarf.CFA.val_offset_sf

constant

Source line 55

std.dwarf.CHILDREN

namespace

Source line 70

std.dwarf.CHILDREN.no

constant

Source line 71

std.dwarf.CHILDREN.yes

constant

Source line 72

std.dwarf.EH

alias

Source line 13

Alias of std.dwarf.EH

std.dwarf.FORM

alias

Source line 11

Alias of std.dwarf.FORM

std.dwarf.Format

container

Source line 14

Fields

@"32"
@"64"

std.dwarf.LANG

alias

Source line 10

Alias of std.dwarf.LANG

std.dwarf.LLE

namespace

Source line 16

std.dwarf.LLE.base_address

constant

Source line 23

std.dwarf.LLE.base_addressx

constant

Source line 18

std.dwarf.LLE.default_location

constant

Source line 22

std.dwarf.LLE.end_of_list

constant

Source line 17

std.dwarf.LLE.offset_pair

constant

Source line 21

std.dwarf.LLE.start_end

constant

Source line 24

std.dwarf.LLE.start_length

constant

Source line 25

std.dwarf.LLE.startx_endx

constant

Source line 19

std.dwarf.LLE.startx_length

constant

Source line 20

std.dwarf.LNCT

namespace

Source line 116

std.dwarf.LNCT.directory_index

constant

Source line 118

std.dwarf.LNCT.hi_user

constant

Source line 124

std.dwarf.LNCT.LLVM_source

constant

Source line 126

std.dwarf.LNCT.lo_user

constant

Source line 123

std.dwarf.LNCT.MD5

constant

Source line 121

std.dwarf.LNCT.path

constant

Source line 117

std.dwarf.LNCT.size

constant

Source line 120

std.dwarf.LNCT.timestamp

constant

Source line 119

std.dwarf.LNE

namespace

Source line 91

std.dwarf.LNE.define_file

constant

Source line 95

std.dwarf.LNE.end_sequence

constant

Source line 93

std.dwarf.LNE.hi_user

constant

Source line 98

std.dwarf.LNE.lo_user

constant

Source line 97

std.dwarf.LNE.padding

constant

Source line 92

std.dwarf.LNE.set_address

constant

Source line 94

std.dwarf.LNE.set_discriminator

constant

Source line 96

std.dwarf.LNE.ZIG_set_decl

constant

Source line 101

std.dwarf.LNS

namespace

Source line 75

std.dwarf.LNS.advance_line

constant

Source line 79

std.dwarf.LNS.advance_pc

constant

Source line 78

std.dwarf.LNS.const_add_pc

constant

Source line 84

std.dwarf.LNS.copy

constant

Source line 77

std.dwarf.LNS.extended_op

constant

Source line 76

std.dwarf.LNS.fixed_advance_pc

constant

Source line 85

std.dwarf.LNS.negate_stmt

constant

Source line 82

std.dwarf.LNS.set_basic_block

constant

Source line 83

std.dwarf.LNS.set_column

constant

Source line 81

std.dwarf.LNS.set_epilogue_begin

constant

Source line 87

std.dwarf.LNS.set_file

constant

Source line 80

std.dwarf.LNS.set_isa

constant

Source line 88

std.dwarf.LNS.set_prologue_end

constant

Source line 86

std.dwarf.OP

alias

Source line 9

Alias of std.dwarf.OP

std.dwarf.RLE

namespace

Source line 129

std.dwarf.RLE.base_address

constant

Source line 135

std.dwarf.RLE.base_addressx

constant

Source line 131

std.dwarf.RLE.end_of_list

constant

Source line 130

std.dwarf.RLE.offset_pair

constant

Source line 134

std.dwarf.RLE.start_end

constant

Source line 136

std.dwarf.RLE.start_length

constant

Source line 137

std.dwarf.RLE.startx_endx

constant

Source line 132

std.dwarf.RLE.startx_length

constant

Source line 133

std.dwarf.TAG

alias

Source line 7

Alias of std.dwarf.TAG

std.dwarf.UT

namespace

Source line 104

std.dwarf.UT.@"type"

constant

Source line 106

std.dwarf.UT.compile

constant

Source line 105

std.dwarf.UT.hi_user

constant

Source line 113

std.dwarf.UT.lo_user

constant

Source line 112

std.dwarf.UT.partial

constant

Source line 107

std.dwarf.UT.skeleton

constant

Source line 108

std.dwarf.UT.split_compile

constant

Source line 109

std.dwarf.UT.split_type

constant

Source line 110

Source code

std/dwarf.zig

//! DWARF debugging data format.
//!
//! This namespace contains unopinionated types and data definitions only. For
//! an implementation of parsing and caching DWARF information, see
//! `std.debug.Dwarf`.

pub const TAG = @import("dwarf/TAG.zig");
pub const AT = @import("dwarf/AT.zig");
pub const OP = @import("dwarf/OP.zig");
pub const LANG = @import("dwarf/LANG.zig");
pub const FORM = @import("dwarf/FORM.zig");
pub const ATE = @import("dwarf/ATE.zig");
pub const EH = @import("dwarf/EH.zig");
pub const Format = enum { @"32", @"64" };

pub const LLE = struct {
    pub const end_of_list = 0x00;
    pub const base_addressx = 0x01;
    pub const startx_endx = 0x02;
    pub const startx_length = 0x03;
    pub const offset_pair = 0x04;
    pub const default_location = 0x05;
    pub const base_address = 0x06;
    pub const start_end = 0x07;
    pub const start_length = 0x08;
};

pub const CFA = struct {
    pub const advance_loc = 0x40;
    pub const offset = 0x80;
    pub const restore = 0xc0;
    pub const nop = 0x00;
    pub const set_loc = 0x01;
    pub const advance_loc1 = 0x02;
    pub const advance_loc2 = 0x03;
    pub const advance_loc4 = 0x04;
    pub const offset_extended = 0x05;
    pub const restore_extended = 0x06;
    pub const @"undefined" = 0x07;
    pub const same_value = 0x08;
    pub const register = 0x09;
    pub const remember_state = 0x0a;
    pub const restore_state = 0x0b;
    pub const def_cfa = 0x0c;
    pub const def_cfa_register = 0x0d;
    pub const def_cfa_offset = 0x0e;

    // DWARF 3.
    pub const def_cfa_expression = 0x0f;
    pub const expression = 0x10;
    pub const offset_extended_sf = 0x11;
    pub const def_cfa_sf = 0x12;
    pub const def_cfa_offset_sf = 0x13;
    pub const val_offset = 0x14;
    pub const val_offset_sf = 0x15;
    pub const val_expression = 0x16;

    pub const lo_user = 0x1c;
    pub const hi_user = 0x3f;

    // SGI/MIPS specific.
    pub const MIPS_advance_loc8 = 0x1d;

    // GNU extensions.
    pub const GNU_window_save = 0x2d;
    pub const GNU_args_size = 0x2e;
    pub const GNU_negative_offset_extended = 0x2f;
};

pub const CHILDREN = struct {
    pub const no = 0x00;
    pub const yes = 0x01;
};

pub const LNS = struct {
    pub const extended_op = 0x00;
    pub const copy = 0x01;
    pub const advance_pc = 0x02;
    pub const advance_line = 0x03;
    pub const set_file = 0x04;
    pub const set_column = 0x05;
    pub const negate_stmt = 0x06;
    pub const set_basic_block = 0x07;
    pub const const_add_pc = 0x08;
    pub const fixed_advance_pc = 0x09;
    pub const set_prologue_end = 0x0a;
    pub const set_epilogue_begin = 0x0b;
    pub const set_isa = 0x0c;
};

pub const LNE = struct {
    pub const padding = 0x00;
    pub const end_sequence = 0x01;
    pub const set_address = 0x02;
    pub const define_file = 0x03;
    pub const set_discriminator = 0x04;
    pub const lo_user = 0x80;
    pub const hi_user = 0xff;

    // Zig extensions
    pub const ZIG_set_decl = 0xec;
};

pub const UT = struct {
    pub const compile = 0x01;
    pub const @"type" = 0x02;
    pub const partial = 0x03;
    pub const skeleton = 0x04;
    pub const split_compile = 0x05;
    pub const split_type = 0x06;

    pub const lo_user = 0x80;
    pub const hi_user = 0xff;
};

pub const LNCT = struct {
    pub const path = 0x1;
    pub const directory_index = 0x2;
    pub const timestamp = 0x3;
    pub const size = 0x4;
    pub const MD5 = 0x5;

    pub const lo_user = 0x2000;
    pub const hi_user = 0x3fff;

    pub const LLVM_source = 0x2001;
};

pub const RLE = struct {
    pub const end_of_list = 0x00;
    pub const base_addressx = 0x01;
    pub const startx_endx = 0x02;
    pub const startx_length = 0x03;
    pub const offset_pair = 0x04;
    pub const base_address = 0x05;
    pub const start_end = 0x06;
    pub const start_length = 0x07;
};

pub const CC = enum(u8) {
    normal = 0x1,
    program = 0x2,
    nocall = 0x3,

    pass_by_reference = 0x4,
    pass_by_value = 0x5,

    GNU_renesas_sh = 0x40,
    GNU_borland_fastcall_i386 = 0x41,

    BORLAND_safecall = 0xb0,
    BORLAND_stdcall = 0xb1,
    BORLAND_pascal = 0xb2,
    BORLAND_msfastcall = 0xb3,
    BORLAND_msreturn = 0xb4,
    BORLAND_thiscall = 0xb5,
    BORLAND_fastcall = 0xb6,

    LLVM_vectorcall = 0xc0,
    LLVM_Win64 = 0xc1,
    LLVM_X86_64SysV = 0xc2,
    LLVM_AAPCS = 0xc3,
    LLVM_AAPCS_VFP = 0xc4,
    LLVM_IntelOclBicc = 0xc5,
    LLVM_SpirFunction = 0xc6,
    LLVM_OpenCLKernel = 0xc7,
    LLVM_Swift = 0xc8,
    LLVM_PreserveMost = 0xc9,
    LLVM_PreserveAll = 0xca,
    LLVM_X86RegCall = 0xcb,
    LLVM_M68kRTD = 0xcc,
    LLVM_PreserveNone = 0xcd,
    LLVM_RISCVVectorCall = 0xce,
    LLVM_SwiftTail = 0xcf,

    pub const lo_user = 0x40;
    pub const hi_user = 0xff;
};

pub const ACCESS = struct {
    pub const public = 0x01;
    pub const protected = 0x02;
    pub const private = 0x03;
};