View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014577CMakeCMakepublic2013-11-18 03:322014-10-06 10:32
ReporterSoeren Textor 
Assigned ToBrad King 
PriorityurgentSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformPCOSWindowsOS Version7 x64
Product VersionCMake 2.8.12 
Target VersionCMake 3.0Fixed in VersionCMake 3.0 
Summary0014577: Need to map /Fd to ProgramDataBaseFileName in VS 7,8,9
DescriptionSince 2.8.12.0 there is no more

<ProgramDataBaseFileName>/MyBinPath/dev/$(Configuration)/MtuX.pdb</ProgramDataBaseFileName>

inside

<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

in the generated visual studio files.

Thus it falls back to the default what is

$(IntDir)vc$(PlatformToolsetVersion).pdb

for VS 2012 and it's not the same...
Steps To ReproduceJust build a VS2012 project and open the vcxproj file.
You won't find any and <ProgramDataBaseFileName>.

We added the /Zi compilerflag before (for vs projects)
Additional Information-
TagsNo tags attached.
Attached Filespatch file icon 0001-VS-Map-Fd-to-ProgramDataBaseFileName-for-VS-7-8-9-14.patch [^] (1,329 bytes) 2013-11-18 11:49 [Show Content]

 Relationships
related to 0011899closedBrad King Put compiler's program database files into intermediate directory rather than output one for VS 2005 
related to 0014062closedBrad King Setting Compiler and Linker PDB to the same path in Visual Studio is unsupported. 
related to 0014600closedBrad King Document PDB behavior w.r.t. static libraries 
related to 0014763closedBrad King Add target properties to specify MS compiler PDB files 

  Notes
(0034458)
Brad King (manager)
2013-11-18 08:36

As reported in 0014062 setting the compiler's PDB file to the same as the linker's is incorrect. This was fixed here:

 VS: Separate compiler and linker PDB files
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42ba1b08 [^]
(0034464)
Mats Fors (reporter)
2013-11-18 10:37
edited on: 2013-11-18 10:46

A use case that has been missed in the discussion about pdb files is that they can be used to contain debug info for a static library. That succinctly is linked into an executable later on. The linker will then use the debug info from the pdb file for the library to build a pdb file for the executable.

Each object file in the library contains an absolute path to its pdb file. The linker will search that path and use that pdb file, if found. Else, if not found, it will look if there is a pdb file, with the name used in the absolute path, in the directory the library resides in.

This worked in cmake until the ProgramDataBaseFileName got decopuled. A remedy would be to allow the compiler /Fd option to set it.

(0034466)
Brad King (manager)
2013-11-18 10:47

Re 0014577:0034464: I brought static libraries up in 0014062:0032761 and the response was 0014062:0032762. The interaction of pdb files and static libraries has been a source of disagreement and confusion for everyone. The two issues I linked from here are not the only ones. You can follow the issue relationships back further from those linked here. The reporter of 0008060:0014062 was the first to cite actual MS documentation on the issue (and a response from MS), so I went with that recommendation.

If "Each object file in the library contains an absolute path to its pdb file" then why can't the linker collect debug symbols from wherever cl puts them?
(0034467)
Brad King (manager)
2013-11-18 10:53

With 2.8.12.1, adding /Fd to the compile flags should map to ProgramDataBaseFileName in the .vcxproj file:

http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVS12CLFlagTable.h;hb=v2.8.12.1#l287 [^]

However, with any Makefile generator with MSVC tools use of /Fd is hard-coded:

http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/Platform/Windows-MSVC.cmake;hb=v2.8.12.1#l234 [^]

so one would have to modify the CMAKE_(C|CXX)_COMPILE_OBJECT rule explicitly to change the flag. This may work but it is an internal CMake variable so changing it in project code may not continue to work in future versions.
(0034468)
Mats Fors (reporter)
2013-11-18 10:57

The absolute path to the pdb file in the object file doesn't necessarily point to the pdb file. Not, if the linkage of the executable is on another host that has another directory structure.

I tried 2.8.12.1 with the studio 2009 generator and I didn't get it to generate the ProgramDataBaseFileName from the /Fd compiler option. Will try one more time tomorrow.
(0034470)
Brad King (manager)
2013-11-18 11:28

Re 0014577:0034468: The /Fd mapping may only work for VS >= 10 (2010). It can be added for older versions if it does not work already.
(0034473)
Brad King (manager)
2013-11-18 11:50

Re 0014577:0034470: Try attached 0001-VS-Map-Fd-to-ProgramDataBaseFileName-for-VS-7-8-9-14.patch to enable the mapping on VS 7, 8, and 9.
(0034476)
Soeren Textor (reporter)
2013-11-19 04:03

Thanks @all. The Link explaining the difference between linker and compiler pdb helps a lot. We just switched and are using the linker pdb only. That works fine for us...
(0034478)
Brad King (manager)
2013-11-19 08:53

Re 0014577:0034473: I've applied the patch:

 VS: Map /Fd to ProgramDataBaseFileName for VS 7,8,9
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf1db496 [^]
(0035209)
Brad King (manager)
2014-02-26 09:44

See 0014763:0035208 for addition of support for COMPILE_PDB_NAME and COMPILE_PDB_OUTPUT_DIRECTORY properties to configure /Fd.
(0036917)
Robert Maynard (manager)
2014-10-06 10:32

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-11-18 03:32 Soeren Textor New Issue
2013-11-18 08:35 Brad King Relationship added related to 0011899
2013-11-18 08:35 Brad King Relationship added related to 0014062
2013-11-18 08:36 Brad King Note Added: 0034458
2013-11-18 10:37 Mats Fors Note Added: 0034464
2013-11-18 10:46 Mats Fors Note Edited: 0034464
2013-11-18 10:47 Brad King Note Added: 0034466
2013-11-18 10:53 Brad King Note Added: 0034467
2013-11-18 10:57 Mats Fors Note Added: 0034468
2013-11-18 11:28 Brad King Note Added: 0034470
2013-11-18 11:49 Brad King File Added: 0001-VS-Map-Fd-to-ProgramDataBaseFileName-for-VS-7-8-9-14.patch
2013-11-18 11:50 Brad King Note Added: 0034473
2013-11-19 04:03 Soeren Textor Note Added: 0034476
2013-11-19 08:53 Brad King Note Added: 0034478
2013-11-19 08:54 Brad King Assigned To => Brad King
2013-11-19 08:54 Brad King Status new => resolved
2013-11-19 08:54 Brad King Resolution open => fixed
2013-11-19 08:54 Brad King Fixed in Version => CMake 3.0
2013-11-19 08:54 Brad King Target Version => CMake 3.0
2013-11-19 08:54 Brad King Summary <ProgramDataBaseFileName> tag is missing in VS XXXX vc(x)proj files since 2.8.12.x => Need to map /Fd to ProgramDataBaseFileName in VS 7,8,9
2013-11-27 10:31 Brad King Relationship added related to 0014600
2014-02-18 09:59 Brad King Relationship added related to 0014763
2014-02-26 09:44 Brad King Note Added: 0035209
2014-10-06 10:32 Robert Maynard Note Added: 0036917
2014-10-06 10:32 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team