Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-30 11:12:18

Vladimir Prus <ghost_at_[hidden]> writes:

> David Abrahams wrote:
>>>>There are lots of ways to generate PDB info, I guess, but the one we
>>>>implement was recommended by Jason Shirk of Microsoft.
>>>I see that for all compiles a PDB file which corresponds to the main target.
>>>However, I don't see PDB files used during linking. Or are the picked up
>> You missed my patch which preceded that message. Try the CVS.
> I'm now confused:
> vc-C++
> ../../../libs/regex/example/bin/regex_timer.test/msvc/debug/runtime-link-dynamic/threading-multi/regex_timer.o
> CALL "C:\Program Files\Microsoft Visual C++\VC98/bin/VCVARS32.BAT" >nul
> ....
> /Fd"../../../libs/regex/example/bin/regex_timer.test/msvc/debug/runtime-link-dynamic/threading-multi/vc60.pdb"
> And later:
> vc-Link
> ../../../libs/regex/example/bin/regex_timer.test/msvc/debug/runtime-link-dynamic/threading-multi/regex_timer
> CALL "C:\Program Files\Microsoft Visual C++\VC98/bin/VCVARS32.BAT" >nul
> ....
> /PDB:"../../../libs/regex/example/bin/regex_timer.test/msvc/debug/runtime-link-dynamic/threading-multi/regex_timer.pdb"
> Why these command lines use diffent PDB files?

I'm not sure I remember what Jason told us about how this works well
enough to answer... Ah, here it is:

Multiple tools produce a PDB file. The compiler will produce one when
the switch -Zi or -ZI is used.

The linker will produce a PDB if the /debug switch is used, regardless
of whether the compiler generated a PDB, /Z7 was used, or no debug info
was generated.

The librarian (lib.exe) does not produce a PDB, so the compiler
generated PDB must be available when invoking the linker and including
the lib.

Ideally, the compiler generated PDB and linker generated PDB should be
the same file, but it isn't a big deal if that's not possible. Just
make sure you the linker generated PDB is available while debugging.

Compiling w/ /Z7 isn't good or bad necessarily. It avoids the PDB until
link time, which is good. It is faster for full builds, but slower for
incremental builds. Also, it would be possible to have MP builds if you
use Z7, but not w /Zi or /ZI since the PDB interface does not support
multiple writers.

I don't think that explains why we have different PDB names.

> Also, how debug symbols for the regexp library get into PDB for the
> exe?

Those mysteries are beyond me ;-)
I think the compiler writes some information into the .obj which
points to the PDB so the linker can pick it up, but I'm not certain.
Maybe Jason can confirm.

David Abrahams
dave_at_[hidden] *
Boost support, enhancements, training, and commercial distribution

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at