Windows: Support backtraces on release builds.

This diff add supports for crash logs on windows for
release builds. This can be toggled on/off with the
`WITH_WINDOWS_PDB` cmake option. by default it is on.

Things to take into consideration:

Release builds are hightly optimized and the resulting
backtraces can be wrong/misleading, take the backtrace
as a general area where the problem resides rather than
an exact location.

By default we ship a minimized symbol file that can only
resolve the function names. This was chosen to strike
a balance between growth in size of the download vs
functionality gained. If more detailed information is
required such as source file + line number information
a full pdb can be shipped by setting `WITH_WINDOWS_STRIPPED_PDB`
to off.

The Release in the title of this diff refers to the
release build type, not the official blender releases.

Initially this will only be enabled for nightly build
bot versions of blender, official releases as of now
will not ship with symbols.

Differential Revision: https://developer.blender.org/D7520

Reviewed by: brecht
This commit is contained in:
Ray Molenkamp
2020-04-30 12:41:16 -06:00
parent 8e08d80e52
commit f90a716e68
9 changed files with 445 additions and 135 deletions

View File

@@ -687,6 +687,14 @@ elseif(WIN32)
)
endif()
if(WITH_WINDOWS_PDB)
if(WITH_WINDOWS_STRIPPED_PDB)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/blender_public.pdb DESTINATION . RENAME blender.pdb)
else()
install(FILES $<TARGET_PDB_FILE:blender> DESTINATION . RENAME blender.pdb)
endif()
endif()
if(WITH_PYTHON)
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
@@ -1085,6 +1093,13 @@ endif()
# the use of vcpkg
if(WIN32)
set_target_properties(blender PROPERTIES VS_GLOBAL_VcpkgEnabled "false")
set_target_properties(blender PROPERTIES
PDB_NAME "blender_private"
PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
if (WITH_WINDOWS_PDB AND WITH_WINDOWS_STRIPPED_PDB)
message("poop : ${COMPILE_PDB_OUTPUT_DIRECTORY}")
target_link_options(blender PRIVATE "/PDBSTRIPPED:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/blender_public.pdb")
endif()
endif()
# -----------------------------------------------------------------------------