| ... | @@ -2465,13 +2465,24 @@ pub const ModuleDebugInfo = switch (native_os) { | ... | @@ -2465,13 +2465,24 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 2465 | module, | 2465 | module, |
| 2466 | relocated_address - coff_section.virtual_address, | 2466 | relocated_address - coff_section.virtual_address, |
| 2467 | ) orelse "???"; | 2467 | ) orelse "???"; |
| | 2468 | // While DWARF gets us just the function's own name, the PDB |
| | 2469 | // stores it qualified with its namespace by the C++ `::` |
| | 2470 | // operator. We can strip that for consistency; the |
| | 2471 | // SymbolInfo will contain the line number, which is a more |
| | 2472 | // language-neutral way of distinguishing same-named symbols |
| | 2473 | // anyway. |
| | 2474 | const symbol_simple_name = if (mem.indexOf(u8, symbol_name, "::")) |cpp_namespace| |
| | 2475 | symbol_name[cpp_namespace + 2 ..] |
| | 2476 | else |
| | 2477 | symbol_name; |
| | 2478 | |
| 2468 | const opt_line_info = try self.pdb.?.getLineNumberInfo( | 2479 | const opt_line_info = try self.pdb.?.getLineNumberInfo( |
| 2469 | module, | 2480 | module, |
| 2470 | relocated_address - coff_section.virtual_address, | 2481 | relocated_address - coff_section.virtual_address, |
| 2471 | ); | 2482 | ); |
| 2472 | | 2483 | |
| 2473 | return SymbolInfo{ | 2484 | return SymbolInfo{ |
| 2474 | .symbol_name = symbol_name, | 2485 | .symbol_name = symbol_simple_name, |
| 2475 | .compile_unit_name = obj_basename, | 2486 | .compile_unit_name = obj_basename, |
| 2476 | .line_info = opt_line_info, | 2487 | .line_info = opt_line_info, |
| 2477 | }; | 2488 | }; |