views:

171

answers:

2

Hi All,

Is there a way to update the PDB file with the new source location ? I have a project which links to some libraries which are built on another machine and are debug build with the PDB file. I cannot put a breakpoint in the files which are compiled in the libs. These libs take more than 4 hours to build so I dont want to buid them on my machine. Is there a way where i can make the compiler use the new source paths. I am using VS 2005 pro c++.

Thanks Amit

A: 

Instead of modifying the .pdb files to adjust to where you have your source, you should be able to make the debugger see the new source path. Look here for instructions on doing this in Visual Studio, and here for instructions on doing this in WinDbg.

Another this StackOverflow question: Best Visual Studio 2008 Debugging Tutorial.

Jared Oberhaus
Hi Jared,Thanks for your reply. I tried your solution, but I still cannot add a break point. Can you point me to some article or resource where I can get a detailed working of the debugger, as how it uses the pdb file. Do you have any other suggestions ?Thanks again for your help.Cheers Amit
amit
I've updated my answer with a link to another StackOverflow question that has lots of links to tutorials. I've seen what you're experiencing, but can't remember what I did to "convince" it where the source was. One strategy might be to set a breakpoint on a function, which you can specify by name instead of clicking on the source.
Jared Oberhaus
A: 

Is the debugger picking up the .pdb files from the wrong location? Do you have a copy of the .pdb files that match the binaries (i.e. .exe, .dll) that you are executing? Keep in mind that the .pdb files can only be used if they were created at the same time as the exact binaries you are executing.

Try the following:

  1. Rename the (stale) .pdb file that the debugger wants to load, so the debugger will no longer try to pick it up.

  2. Go to Tools->Options->Debugging->Symbols and add the symbol file (.pdb) location to the list.

  3. If the debugger is already attached, right click on the module in the "Modules" list and click "Load symbols". This will re-load the symbols from the path you entered.

Also, if you know the code is exactly the same, but your .pdb file doesn't match the binaries you are using because they were created during different builds, try un-checking the following checkbox:

Tools->Options->Debugging->Require source files to exactly match the original version

LeopardSkinPillBoxHat