<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58068>58068</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            PDB generated from cross-compiled mingw targets don't show source lines in MS debuggers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nedsociety
      </td>
    </tr>
</table>

<pre>
    * Ubuntu clang version 15.0.2-++20220926063022+451e3b68306d-1~exp1~20220926063118.66
* mingw-w64 9.4
* Build configuration:
  * Target triplet: i686-w64-windows-gnu target
  * The binary was cross-compiled from Ubuntu, so no `clang-cl` nor `lld-link` but instead `clang` and `ld.lld` are used.
  * Compiler call includes `-g -gcodeview`
  * Linker call to the driver includes `-fuse-ld=lld-15 -debug -Xlinker -pdb=Hyperspace.pdb`

The generated PDB, when plugged into VS2022 debugging session, shows the following message when the debugger is stopped:

![image](https://user-images.githubusercontent.com/11943013/193124118-a884a719-ab51-4c9d-84c4-04a76ee81a01.png)

Note that the symbol names are somewhat available from the Call Stacks window below (`Hyperspace.dll!__do_global_ctors()`). The name isn't shown when the PDB is not present, so I guess PDB _does_ provide symbol names but not source lines for some reason.

Expected behavior is that VS IDE should ask where the source file is.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxdVMtu4zYU_Rp5Q1AQ9bK00CKJU3SAtiiQdjA7gyKvZTY0KZCUNf77XtJO7Awg2NR933MONVp5GbLyifw7LiYsRGhuJnIG55U1hDV5kZc0K5_xKYuyLPqyLdoKT2ioGwbV2HZV0UrKsu0r_Jzj30MgY13etlmxy4qn2OWkzLTSta1Jn9d38_OitCTCmoOaFscD9s6qp6ufkBjxD3cTBBKcmjUEdBLVdm2sRFdlpF09ncxCQgr7kngEMirD3YWs3BPhrPdU2NOsNEhycPZ0Wz0rX4i3xFiStUWCgQqNR7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