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 › Dwarf › getLineNumberInfo Public Function getLineNumberInfo Doc Source 1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319 pub fn getLineNumberInfo (
d : *Dwarf ,
gpa : Allocator ,
text_arena : Allocator ,
endian : Endian ,
compile_unit : *CompileUnit ,
target_address : u64 ,
) !std .debug .SourceLocation {
try d .populateSrcLocCache (gpa , endian , compile_unit );
const slc = &compile_unit .src_loc_cache .?;
const entry = try slc .findSource (target_address );
const file_index = entry .file - @intFromBool (slc .version < 5 );
if (file_index >= slc .files .len ) return bad ();
const file_entry = &slc .files [file_index ];
if (file_entry .dir_index >= slc .directories .len ) return bad ();
const dir_name = slc .directories [file_entry .dir_index ].path ;
const file_name = try std .fs .path .join (text_arena , &.{ dir_name , file_entry .path });
return .{
.line = entry .line ,
.column = entry .column ,
.file_name = file_name ,
};
}