mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 07:03:11 +00:00
ModuleDebugInfo: Discard C++ namespaces appearing in PDBs
This commit is contained in:
parent
9c2d597e69
commit
3bfa63aa61
@ -2465,13 +2465,24 @@ pub const ModuleDebugInfo = switch (native_os) {
|
||||
module,
|
||||
relocated_address - coff_section.virtual_address,
|
||||
) orelse "???";
|
||||
// While DWARF gets us just the function's own name, the PDB
|
||||
// stores it qualified with its namespace by the C++ `::`
|
||||
// operator. We can strip that for consistency; the
|
||||
// SymbolInfo will contain the line number, which is a more
|
||||
// language-neutral way of distinguishing same-named symbols
|
||||
// anyway.
|
||||
const symbol_simple_name = if (mem.indexOf(u8, symbol_name, "::")) |cpp_namespace|
|
||||
symbol_name[cpp_namespace + 2 ..]
|
||||
else
|
||||
symbol_name;
|
||||
|
||||
const opt_line_info = try self.pdb.?.getLineNumberInfo(
|
||||
module,
|
||||
relocated_address - coff_section.virtual_address,
|
||||
);
|
||||
|
||||
return SymbolInfo{
|
||||
.symbol_name = symbol_name,
|
||||
.symbol_name = symbol_simple_name,
|
||||
.compile_unit_name = obj_basename,
|
||||
.line_info = opt_line_info,
|
||||
};
|
||||
|
||||
@ -2457,8 +2457,7 @@ pub const Object = struct {
|
||||
// We still may want these for a Zig expression
|
||||
// evaluator in debuggers, but for now they are
|
||||
// completely useless.
|
||||
.ComptimeInt, .ComptimeFloat,
|
||||
.Type, .Undefined, .Null, .EnumLiteral => continue,
|
||||
.ComptimeInt, .ComptimeFloat, .Type, .Undefined, .Null, .EnumLiteral => continue,
|
||||
else => {},
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user