feature. See also
. The project being documented here (as the example) is the Zig library itself.
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
File
Code
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)),
.column = 0,
.file_name = file_name,
};
}
return null;
}