Should PDB contain demangled symbols?

I’m able to generate a PDB using a combination of gcc+lld on Windows (under MinGW) which is then loaded successfully by windbg, however the symbols are shown in mangled form.

MSVC appears to output symbols to PDB in demangled form, so they show up as such in windbg and other debuggers.

Is there a reason the names are stored in PDB in mangled form by lld? Should it be respecting the setting of the --no-demangle option (i.e., demangled by default)?

I believe (but could be wrong) that the PDB always has the mangled names, and that windbg and others then demangle them for display. Since gcc (and clang in mingw mode) uses a different mangling scheme than MSVC, windbg probably cannot demangle those names.

A very unscientific skim through the PDB generated by MSVC with a hex editor shows names in both mangled and unmangled form, however this may be coincidence and unrelated.

The dbghlp API does provide support for demangling names, and it’s logical to assume it would only support the Microsoft scheme, so you may well be correct. Can anyone confirm with certainty relating to the PDB format itself?