title: clang 5.0 pdb support as of 2017
body: <p>Here it is explained that clang now knows how to produce .pdb files (<a href="http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html" rel="nofollow noreferrer">http://blog.llvm.org/2017/08/llvm-on-windows-now-supports-pdb-debug.html</a>).</p>
  
  <p>As far as I understand, at least clang with Microsoft linker is now expected to produce .pdb files equivalent to those produced by the msvc toolchain.</p>
  
  <p>It is explained here how you can use mainstream Visual Studio 2017 to debug an "external" binary, that is one not built using projects/solutions (<a href="https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-debug-an-executable-not-part-of-a-visual-studio-solution" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-debug-an-executable-not-part-of-a-visual-studio-solution</a>).</p>
  
  <p>I have compiled a simple hello world application with <code>clang -g main.c -o main.exe</code> which produced a .pdb file as expected.</p>
  
  <p>However, when I try to step into it, Visual Studio complains that the .pdb file does not contain line number information.</p>
  
  <p>In contrast, compiling with <code>cl /EHsc /Zi main.c</code> allows to debug with Visual Studio normally.</p>
  
  <p>I am currently trying to understand if clang ecosystem is already good enough for developing on Windows, and will appreciate if somebody can explain:</p>
  
  <ol>
  <li>What is the difference between .pdb files produced by stable clang and msvc?</li>
  <li>Is there any difference between <code>link</code> and <code>lld</code> for that matter?</li>
  <li>Are things going to change in clang 6.0?</li>
  </ol>