Use -g -gcolumn-info -gcodeview
when compiling, then -fuse-ld=lld -g -Wl,--pdb=
when linking. This produces ??.pdb
alongside ??.exe
.
You can also pass a custom PDB file path to -Wl,--pdb=??
.
I'm unsure if -g
does anything when linking, but the Clang doesn't warn about it, so I prefer to keep it. It does warn about -gcodeview
being unused if specified when linking.