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 › Pdb › getInlineSiteSourceLocation Public Function getInlineSiteSourceLocation Doc Source Public Function std.debug.Pdb.getInlineSiteSourceLocation
pub fn getInlineSiteSourceLocation (
self : *Pdb ,
gpa : Allocator ,
mod : *Module ,
site : *align (1 ) const pdb .InlineSiteSym ,
inlinee_src_line : *align (1 ) const pdb .InlineeSourceLine ,
offset_in_func : usize ,
) !?std .debug .SourceLocation Params self : *Pdb gpa : Allocator mod : *Module site : *align (1 ) const pdb .InlineSiteSym inlinee_src_line : *align (1 ) const pdb .InlineeSourceLine offset_in_func : usize File debug/Pdb.zig: 627
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651 pub fn getInlineSiteSourceLocation (
self : *Pdb ,
gpa : Allocator ,
mod : *Module ,
site : *align (1 ) const pdb .InlineSiteSym ,
inlinee_src_line : *align (1 ) const pdb .InlineeSourceLine ,
offset_in_func : usize ,
) !?std .debug .SourceLocation {
var ranges : BinaryAnnotation .RangeIterator = .init (self .getBinaryAnnotations (mod , site ));
while (try ranges .next ()) |range | {
if (!range .contains (offset_in_func )) continue ;
const file_id = range .file_id orelse inlinee_src_line .file_id ;
const file_name = try self .getFileName (gpa , mod , file_id );
errdefer self .allocator .free (file_name );
return .{
.line = inlinee_src_line .source_line_num +% @as (u32 , @bitCast (range .line_offset )),
// LLVM doesn't currently emit column information for inlined calls in PDBs.
.column = 0 ,
.file_name = file_name ,
};
}
return null ;
}