Zig 0.17.0-dev (Split by item) 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.
std › debug › cpu_context › Mips › dwarfRegisterBytes Public Function dwarfRegisterBytes Doc Source Public Function std.debug.cpu_context.Mips.dwarfRegisterBytes
pub fn dwarfRegisterBytes (ctx : *Mips , register_num : u16 ) DwarfRegisterError ![]u8 Params ctx : *Mips register_num : u16 Errors InvalidRegister UnsupportedRegister File debug/cpu_context.zig: 1105
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124 pub fn dwarfRegisterBytes (ctx : *Mips , register_num : u16 ) DwarfRegisterError ![]u8 {
switch (register_num ) {
0 ...31 => return @ptrCast (&ctx .r [register_num ]),
66 => return @ptrCast (&ctx .pc ),
// Who the hell knows what numbers exist for this architecture? What's an ABI
// specification anyway? We don't need that nonsense.
32 ...63 => return error .UnsupportedRegister , // f0 - f31, w0 - w31
64 => return error .UnsupportedRegister , // hi0 (ac0)
65 => return error .UnsupportedRegister , // lo0 (ac0)
176 => return error .UnsupportedRegister , // hi1 (ac1)
177 => return error .UnsupportedRegister , // lo1 (ac1)
178 => return error .UnsupportedRegister , // hi2 (ac2)
179 => return error .UnsupportedRegister , // lo2 (ac2)
180 => return error .UnsupportedRegister , // hi3 (ac3)
181 => return error .UnsupportedRegister , // lo3 (ac3)
else => return error .InvalidRegister ,
}
}