Boost logo

Boost-Build :

From: mbartosik (mbartosik_at_[hidden])
Date: 2004-12-11 03:41:19


With MSVC (and Intel on Windows), .PDB files are essential to
debugging. This is not just for debug builds but for release builds
too.

With the boost build system a PDB file will be generated when:

<debug-symbols>on
<debug-store>database

Without a .PDB the generated images cannot be debugged either for a
live process or a .DMP file (like a unix core file). Microsoft has
wisely with VS7 (Visual Studio 7 / .NET) and above made generation
of .PDB files the default for both release and debug builds (it was
not default for VS6).

If <debug-store> is set to 'object' then the debugging information is
built into the library files (static and dynamic link). This bloats
dynamic link libraries, and is thus not the preferred mechanism for
dynamic link libraries, but is still very good for static link.

It is my firm belief that software (inc boost) when built with MSVC
(or Intel on Windows) should always generate debugging information.
Since the .PDB is a separate file it does not bloat the generated
executable image and is not typically shipped. An experienced
developer is likely to turn debug symbols on, but the defaults should
cater for the inexperienced too. It is not practical to generate
a .PDB only after a crash because the MS linker uses GUIDs in the
image and the .PDB.

The default place to install a .PDB file is the libdir (see
C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib). With
Microsoft they place .PDB files for static links into the libdir and
allow you to download the .PDB files for dynamic links from their
symbols server.

I would like to propose that the boost build for at least MSVC and
Intel on Windows do the following:

variant release
<debug-symbols>on
# <debug-store> database for dynamic link - research pending for
static link

I don't know enough about the downsides on platforms other than
Microsoft (e.g. executable image bloat due to a .debug section), but
<debug-symbols>on might be suitable for variant common.

IMPORTANTLY
===========
For the install and stage rules.
For static link the generated .PDB files should be installed to
libdir.
For dynamic link the generated .PDB files should be installed to
bindir.
The install and staging should be conditional on <debug-symbols>on
<debug-store>database.

Changing the install and stage rules I expect to be more difficult
and thus more important as it is easy to set <debug-symbols>on.

Andreas Huber raised a similar point (on Nov 9 2004)
http://groups.yahoo.com/group/jamboost/message/7893
and Vladimir Prus gave a good reply but my proposal is to change the
default way the boost builds with MSVC (which is different to what
Andreas asked).

I am hoping that one of the build experts will reply, and agree to
update the build rules. If the experts agree I'll research the issues
between using /Zi and /Z7 for static link libraries so that boost can
default to the best (if there is one).

Thanks

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk