Packaging debug symbol files on Windows

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Packaging debug symbol files on Windows

Andreas Pakulat-2
Hi,

I'm trying to generate a zip file (on Windows) for a shared library including the generated debug symbols in pdb files with CPack. Unfortunately CPack does not seem to pick up the pdb files all by itself and after cross-reading the cpack docs in the cmake wiki I didn't see any switch to enable such behavior.

Did somebody already do this and if so how?

Andreas

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Packaging debug symbol files on Windows

Nils Gladitz-2
On 07/27/2015 02:25 PM, Andreas Pakulat wrote:
> Hi,
>
> I'm trying to generate a zip file (on Windows) for a shared library
> including the generated debug symbols in pdb files with CPack.
> Unfortunately CPack does not seem to pick up the pdb files all by itself
> and after cross-reading the cpack docs in the cmake wiki I didn't see
> any switch to enable such behavior.
>
> Did somebody already do this and if so how?

What gets installed is decided by install() commands in your project
rather than by CPack.

You can use the $<TARGET_PDB_FILE:tgt> [1] generator expression to
install pdb files.

e.g. install(FILES $<TARGET_PDB_FILE:my_target> DESTINATION bin)

Nils

[1]
http://www.cmake.org/cmake/help/v3.3/manual/cmake-generator-expressions.7.html
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Packaging debug symbol files on Windows

Andreas Pakulat-2
Hi Nils,

On Mon, Jul 27, 2015 at 3:12 PM, Nils Gladitz <[hidden email]> wrote:
On 07/27/2015 02:25 PM, Andreas Pakulat wrote:
Hi,

I'm trying to generate a zip file (on Windows) for a shared library
including the generated debug symbols in pdb files with CPack.
Unfortunately CPack does not seem to pick up the pdb files all by itself
and after cross-reading the cpack docs in the cmake wiki I didn't see
any switch to enable such behavior.

Did somebody already do this and if so how?

What gets installed is decided by install() commands in your project rather than by CPack.

You can use the $<TARGET_PDB_FILE:tgt> [1] generator expression to install pdb files.

e.g. install(FILES $<TARGET_PDB_FILE:my_target> DESTINATION bin)

Ah, interesting. I would've thought that an install() would automatically include the pdb files, after all those are usually useful after the build process and the builddir is often gone once a library is being used.

I've meanwhile also noticed that the default compiler flags that CMake uses include the debug information in the dll itself (dll size is doubled), so for now don't even have to have the separate pdb files packaged anymore (in this case the pdb info is small enough to just keep in the dll).

Thanks for the pointer.

Andreas
 

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Packaging debug symbol files on Windows

Nils Gladitz-2
On 07/27/2015 03:46 PM, Andreas Pakulat wrote:
> I've meanwhile also noticed that the default compiler flags that CMake
> uses include the debug information in the dll itself (dll size is
> doubled), so for now don't even have to have the separate pdb files
> packaged anymore (in this case the pdb info is small enough to just keep
> in the dll).

I am not entirely sure what you mean but CMake's default flags for the
Visual Studio compiler when building "Debug" or "RelWithDebInfo" use /Zi
(debug information in external pdb) rather than /Z7 (embedded debug
information; no pdb is generated).

Maybe your project replaces the default flags?

Nils
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Packaging debug symbol files on Windows

Andreas Pakulat-2
Hi Nils,

On Mon, Jul 27, 2015 at 3:58 PM, Nils Gladitz <[hidden email]> wrote:
On 07/27/2015 03:46 PM, Andreas Pakulat wrote:
I've meanwhile also noticed that the default compiler flags that CMake
uses include the debug information in the dll itself (dll size is
doubled), so for now don't even have to have the separate pdb files
packaged anymore (in this case the pdb info is small enough to just keep
in the dll).

I am not entirely sure what you mean but CMake's default flags for the Visual Studio compiler when building "Debug" or "RelWithDebInfo" use /Zi (debug information in external pdb) rather than /Z7 (embedded debug information; no pdb is generated).

Maybe your project replaces the default flags?

No Z7 or Zi anywhere in the CMake files and the generated makefiles include /Zi. So I don't know why the dll's would be bigger and generate proper backtrace information when analyzing a dump file but so it is and thats fine with me for now.

Andreas

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Packaging debug symbol files on Windows

J Decker
Debug also adds padding between functions and stack checking which can significantly add to code size for smaller libraries...  or libraries with lots of tiny functions.

On Mon, Jul 27, 2015 at 9:13 AM, Andreas Pakulat <[hidden email]> wrote:
Hi Nils,

On Mon, Jul 27, 2015 at 3:58 PM, Nils Gladitz <[hidden email]> wrote:
On 07/27/2015 03:46 PM, Andreas Pakulat wrote:
I've meanwhile also noticed that the default compiler flags that CMake
uses include the debug information in the dll itself (dll size is
doubled), so for now don't even have to have the separate pdb files
packaged anymore (in this case the pdb info is small enough to just keep
in the dll).

I am not entirely sure what you mean but CMake's default flags for the Visual Studio compiler when building "Debug" or "RelWithDebInfo" use /Zi (debug information in external pdb) rather than /Z7 (embedded debug information; no pdb is generated).

Maybe your project replaces the default flags?

No Z7 or Zi anywhere in the CMake files and the generated makefiles include /Zi. So I don't know why the dll's would be bigger and generate proper backtrace information when analyzing a dump file but so it is and thats fine with me for now.

Andreas

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake