Bug #52850: mysqld-debug.pdb doesn't match

mysqld-debug.exe in 5.5.3 on windows

Fix:

- Do not rename PDB, install mysqld.pdb matching 
mysqld-debug.exe into bin\debug subdirectory

- Stack tracing code will now additionally look in 
debug subdirectory of the application directory 
for debug symbols.

- Small cleanup in stacktracing code: link with 
dbghelp rather than load functions dynamically 
at runtime, since dbghelp.dll is always present.

- Install debug binaries with WiX

cmake/install_macros.cmake:
  Add optional COMPONENT and PDB_DESTINATION 
  to INSTALL_DEBUG_TARGET
mysys/stacktrace.c:
  If binary is build with DBUG, also look in debug subdirectory
  of  executable directory. Packaging will put some PDBs there
  (e.g bin\mysqld-debug.exe will have corresponding pdb in 
  bin\debug)
  
  Also some cleanup: do not load dbghelp dynamically, instead
  link with it. dbghelp is present on all Windows starting with 
  XP.
packaging/WiX/CPackWixConfig.cmake:
  Install debug binaries
sql/CMakeLists.txt:
  Do not rename PDB for mysqld-debug.exe, install it in debug subdirectory
This commit is contained in:
Vladislav Vaintroub 2010-06-30 14:10:29 +02:00
commit 1134fe2fdb
4 changed files with 81 additions and 108 deletions

View file

@ -250,7 +250,7 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug
FUNCTION(INSTALL_DEBUG_TARGET target)
CMAKE_PARSE_ARGUMENTS(ARG
"DESTINATION;RENAME"
"DESTINATION;RENAME;PDB_DESTINATION;COMPONENT"
""
${ARGN}
)
@ -269,6 +269,9 @@ FUNCTION(INSTALL_DEBUG_TARGET target)
ELSE()
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" )
ENDIF()
IF(NOT ARG_COMPONENT)
SET(ARG_COMPONENT DebugBinaries)
ENDIF()
# Define permissions
# For executable files
@ -305,19 +308,26 @@ FUNCTION(INSTALL_DEBUG_TARGET target)
${RENAME_PARAM}
${PERMISSIONS_${target_type}}
CONFIGURATIONS Release RelWithDebInfo
COMPONENT ${ARG_COMPONENT}
OPTIONAL)
IF(MSVC)
GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT)
STRING(REPLACE "${ext}" ".pdb" debug_pdb_target_location "${debug_target_location}" )
IF(RENAME_PARAM)
STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename)
SET(PDB_RENAME_PARAM RENAME ${pdb_rename})
IF (RENAME_PARAM)
IF(NOT ARG_PDB_DESTINATION)
STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename)
SET(PDB_RENAME_PARAM RENAME "${pdb_rename}")
ENDIF()
ENDIF()
IF(NOT ARG_PDB_DESTINATION)
SET(ARG_PDB_DESTINATION "${ARG_DESTINATION}")
ENDIF()
INSTALL(FILES ${debug_pdb_target_location}
DESTINATION ${ARG_DESTINATION}
${RPDB_RENAME_PARAM}
DESTINATION ${ARG_PDB_DESTINATION}
${PDB_RENAME_PARAM}
CONFIGURATIONS Release RelWithDebInfo
COMPONENT ${ARG_COMPONENT}
OPTIONAL)
ENDIF()
ENDFUNCTION()