4

Where can I find a llvm-pdbutil from LLVM? Few people mentioned it comes with installation package, but I could not find any inside.

valiano
  • 16,433
  • 7
  • 64
  • 79
def
  • 521
  • 4
  • 16

1 Answers1

7

llvm-pdbutil is part of the LLVM Compiler toolchain.

It isn't currently distributed with the LLVM binaries, at least not with 7.0.0, so you'll have to build LLVM from source for obtaining it.

However, if you don't mind using a home-brewed 64-bit Windows build, try mine:
https://github.com/shaharv/llvm-pdbutil-builds/releases

It is built from 9.0.0svn (developement branch) on Windows 10 and Visual Studio 2017 Community. Note that Visual Studio 2015 C++ Redistributable is required.

Also, make sure to visit the llvm-pdbutil project homepage for getting started. Good luck! https://llvm.org/docs/CommandGuide/llvm-pdbutil.html

valiano
  • 16,433
  • 7
  • 64
  • 79
  • Hmm, interesting... Just in case, please try with: `llvm-pdbutil dump -all your.pdb`. If invoked with just the pdb name, which is the intuituve way, it will do nothing and return silently (that was the first thing I tried myself). – valiano Feb 07 '19 at 17:36
  • Can you build with static run-time libraries? MSVCP140 is not found. – def Feb 07 '19 at 21:33
  • Right, the VC++ redistributable... I'll try. – valiano Feb 08 '19 at 06:03
  • Hey, thank you so much for making this available. FYI: Works fine on the latest Windows 10 1809 build. – Sabuncu Feb 09 '19 at 18:54
  • @def I'm sorry, but I wasn't able to prepare a static build - it fails with many linking errors. I'm not sure how well static windows builds are supported today. – valiano Feb 09 '19 at 19:06
  • OK, I am getting `llvm-pdbutil: An unknown error has occurred. HRESULT: 0x800700C1: Calling NoRegCoCreate` when I try with .NET Framework pdb files; for example, mscorlib.pdb, PresentationFramework.pdb. I tried it on two different Windows 10 machines, identical error. – Sabuncu Feb 09 '19 at 19:37
  • @Sabuncu Interesting. It looks like failing to load the DIA dll (see `LoadDIA` in http://llvm.org/doxygen/DIASession_8cpp_source.html). Do you happen do have Visual Studio 2015/17 installed? If so, please check whether `msdia140.dll` is reachable from your `PATH`. – valiano Feb 09 '19 at 22:09
  • If you're missing `msdia140.dll`, please grab the following: https://github.com/shaharv/llvm-pdbutil-builds/releases/download/v0.2/llvm-pdbutil-9.0.0svn-win64-msdiadll.7z – valiano Feb 10 '19 at 07:11
  • I have up-to-date release of VS2017 Community installed. I confirmed that msdia140.dll is reachable via PATH through two folders: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\ C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ – Sabuncu Feb 10 '19 at 08:49
  • I downloaded the zip file you shared containing the msdia140.dll and the llvm-pdbutil.exe and ran them from the same folder, to assure that the dll gets picked up from the folder and not the PATH, but got the exact same error message. – Sabuncu Feb 10 '19 at 09:03
  • @Sabuncu what happens if you register the msdia dll with `regsvr32 msdia140.dll` first? – valiano Feb 10 '19 at 10:24
  • I ran regsvr32 through an elevated cmd, and it was successful. But the llvm-pdbutil returned the same error as before. – Sabuncu Feb 10 '19 at 11:52
  • @Sabuncu Very puzzling... I guess the way forward would be trying to figure out why `msdia140.dll` could not be loaded. Sorry I couldn't help more with this at the moment. I'll let you know if I have any other ideas. – valiano Feb 10 '19 at 12:06
  • 1
    @Sabuncu One last try. Could you please try `regsvr32 msdia140.dll` with the DLL from https://github.com/shaharv/llvm-pdbutil-builds/releases/download/v0.3/llvm-pdbutil-9.0.0svn-win64-msdiadll64.7z? It's the `amd64` DLL version (didn't ask, but I assume you're on 64-bit Windows?). My best bet is that there's some 32/64 bit mismatch. – valiano Feb 11 '19 at 07:25
  • Success! :) With the pretty attribute, it reported Size, Guid, Age and Attributes information! Thank you so much. I am indeed on a 64-bit Windows 10 w/ an AMD Ryzen processor. It also works on a Xeon-based Azure Windows 10 server. Have to say that I admire your tenacity in going after a problem. You don't give up! :) This will allow me to get to know this command which is always a good thing. My ultimate goal is to be able to step into .NET framework code during debugging. However, I have not been able to find matching PDBs for framework DLLs. – Sabuncu Feb 11 '19 at 11:28
  • 1
    FWIW it comes with installation now (as per 15.0.7) – andresp May 18 '23 at 10:37