commit a1a8dd1b40d2f42e9df6fee053c2cb737e0753f7 (tree)
parent 781bab193b3ea026d2bd6adf8150bb6510205766
Author: Mason Remaley <mason@gamesbymason.com>
Date: Tue, 7 Apr 2026 13:51:35 -0700
Filters out duplicate sites, outputs compile unit name
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/std/debug/SelfInfo/Windows.zig b/lib/std/debug/SelfInfo/Windows.zig
@@ -68,9 +68,18 @@ pub const SymbolIterator = struct {
if (pdb.getInlineeInfo(info.module, site.inlinee) catch null) |loc| {
const offset_in_func = info.addr - proc.code_offset;
if (try pdb.calculateOffset(site, loc, offset_in_func)) |offset| {
+ // If we've found a match, filter out any duplicate sites that
+ // follow. Tools like llvm-addr2line output duplicate sites in the
+ // same cases as us, implying that they exist in the underlying
+ // data and are not indicative of a parser bug.
+ while (info.inline_sites.getLastOrNull()) |top| {
+ if (top.inlinee != site.inlinee) break;
+ _ = info.inline_sites.pop();
+ }
+
return .{
.name = pdb.findInlineeName(site.inlinee),
- .compile_unit_name = null,
+ .compile_unit_name = fs.path.basename(info.module.obj_file_name),
.source_location = offset,
};
}