|
Boost : |
From: Jason Shirk (jasonsh_at_[hidden])
Date: 2002-02-26 18:41:22
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.
Jason Shirk
VC++ Compiler Team
-----Original Message-----
From: bill_kempf [mailto:williamkempf_at_[hidden]]
Sent: Tuesday, February 26, 2002 9:14 AM
To: boost_at_[hidden]
Subject: [boost] Jam and PDB files
I had a user e-mail me asking if Jam could produce PDB files. At
first I was surprised by this, since I thought Jam was producing the
PDB files. However, the only PDB being generated is the vc?0.pdb
file. Well, I've always relied on the IDE to set this stuff up for
me, so I didn't have a clue about how to specify things on the
command line and had to start doing some research. Here's a diff of
msvc-tools.jam that I did to generate the "project" PDB files:
C:\home\boost\tools\build>cvs diff
? jam_src/bin.ntx86
Index: msvc-tools.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/msvc-tools.jam,v
retrieving revision 1.20
diff -c -r1.20 msvc-tools.jam
*** msvc-tools.jam 17 Feb 2002 22:46:30 -0000 1.20
--- msvc-tools.jam 26 Feb 2002 17:01:26 -0000
***************
*** 22,28 ****
}
flags msvc CFLAGS <debug-symbols>on : /Zi ;
! flags msvc LINKFLAGS <debug-symbols>on : /DEBUG ;
flags msvc CFLAGS <optimization>off : /Od ;
flags msvc CFLAGS <optimization>speed : /O2 ;
--- 22,28 ----
}
flags msvc CFLAGS <debug-symbols>on : /Zi ;
! flags msvc LINKFLAGS <debug-
symbols>on : /DEBUG /debugtype:cv /pdbtype:con ;
flags msvc CFLAGS <optimization>off : /Od ;
flags msvc CFLAGS <optimization>speed : /O2 ;
Now there are few issues left, and I don't have the knowledge to
address them.
Static link libraries aren't "executables" (well, niether are DLLs,
but in this case the linker treats DLLs as "executable") so a
<project>.pdb file is not generated. However, the vc?0.pdb file is
still generated, but is generated in the build directory (and thus
causes a name clash with other builds). I tried to research this and
have a few links that suggest for static libraries we should be using
the /Z7 switch. However, I honestly don't know if this is misguided
advice or not. Here are some links that describe this:
http://groups.google.com/groups?
q=vc60.pdb&start=30&hl=en&selm=EK7E3.1224%24nV6.1343%40client&rnum=31
http://groups.google.com/groups?hl=en&selm=38480E48.CEB0E1F4%
40cavedog.com
http://groups.google.com/groups?hl=en&selm=qKpK3.1686%241h3.80430%
40monger.newsread.com
http://www.therationaledge.com/content/apr_01/t_debug_gb.html
Another issue is whether or not the Jam rules should provide an
explicit way to set this stuff. The VC++ IDE generates PDB files by
default, and that's what most people are going to expect and want.
But there may be others that want a different form of debug
information, so simply turning it on for all debug builds like I did
may not be the correct solution.
Hopefully VC++ experts and Jam developers can help resolve these
issues.
Bill Kempf
Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk