| ... | @@ -68,9 +68,18 @@ pub const SymbolIterator = struct { | ... | @@ -68,9 +68,18 @@ pub const SymbolIterator = struct { |
| 68 | if (pdb.getInlineeInfo(info.module, site.inlinee) catch null) |loc| { | 68 | if (pdb.getInlineeInfo(info.module, site.inlinee) catch null) |loc| { |
| 69 | const offset_in_func = info.addr - proc.code_offset; | 69 | const offset_in_func = info.addr - proc.code_offset; |
| 70 | if (try pdb.calculateOffset(site, loc, offset_in_func)) |offset| { | 70 | if (try pdb.calculateOffset(site, loc, offset_in_func)) |offset| { |
| | 71 | // If we've found a match, filter out any duplicate sites that |
| | 72 | // follow. Tools like llvm-addr2line output duplicate sites in the |
| | 73 | // same cases as us, implying that they exist in the underlying |
| | 74 | // data and are not indicative of a parser bug. |
| | 75 | while (info.inline_sites.getLastOrNull()) |top| { |
| | 76 | if (top.inlinee != site.inlinee) break; |
| | 77 | _ = info.inline_sites.pop(); |
| | 78 | } |
| | 79 | |
| 71 | return .{ | 80 | return .{ |
| 72 | .name = pdb.findInlineeName(site.inlinee), | 81 | .name = pdb.findInlineeName(site.inlinee), |
| 73 | .compile_unit_name = null, | 82 | .compile_unit_name = fs.path.basename(info.module.obj_file_name), |
| 74 | .source_location = offset, | 83 | .source_location = offset, |
| 75 | }; | 84 | }; |
| 76 | } | 85 | } |