New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbols file for stacktrace is not loaded after deployment in Windows #55
Comments
see also #47 (comment) |
If anyone else is struggling with this issue, here's a works-for-me workaround:
In case application's working directory differs from the PDBs' location and the latter is not known at link stage (e.g. user can change the install location), here's an additional step:
wchar_t path[MAX_PATH];
GetModuleFileNameW( nullptr, path, MAX_PATH );
PathRemoveFileSpecW( path );
SetEnvironmentVariableW( L"_NT_SYMBOL_PATH", path ); |
A small change to the work around emptyVoid suggests above is to set |
I've reported the underlying issue to the Microsoft 'Feedback Hub' using Category "Developer Platform" and Subcategory "Debugging Tools for Windows" Feel free to upvote ... |
Added description of that issue to the docs. |
I don't know why the solution provided by @emptyVoid for setting the env variable doesn't work for me with the So I had to start trying the linker option It looks very simple, just So if you try And I couldn't find any mention of the "%" escape in their documentation. This is the bug report for it: Since I didn't find any way to suppress the "%" escape, my workaround is pretty hacky: at the end of the top-level Now the library is working for me. Here is the code, hopefully it will save close to 6 hours for some people. 😭 macro(get_all_targets_recursive targets dir)
get_property(subdirectories DIRECTORY ${dir} PROPERTY SUBDIRECTORIES)
foreach(subdir ${subdirectories})
get_all_targets_recursive(${targets} ${subdir})
endforeach()
get_property(current_targets DIRECTORY ${dir} PROPERTY BUILDSYSTEM_TARGETS)
list(APPEND ${targets} ${current_targets})
endmacro()
function(get_all_targets var)
set(targets)
get_all_targets_recursive(targets ${CMAKE_CURRENT_SOURCE_DIR})
set(${var} ${targets} PARENT_SCOPE)
endfunction()
function(apply_pdbaltpath_pdb_for_all_targets)
get_all_targets(ALL_TARGETS)
foreach(TARGET_NAME ${ALL_TARGETS})
get_target_property(OUTPUT_NAME ${TARGET_NAME} OUTPUT_NAME)
if ("${OUTPUT_NAME}" STREQUAL "OUTPUT_NAME-NOTFOUND" OR "${OUTPUT_NAME}" STREQUAL "")
set(OUTPUT_NAME ${TARGET_NAME})
endif()
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS "/PDBALTPATH:${OUTPUT_NAME}.pdb")
endforeach()
endfunction()
# At the end of the top-level CMakeLists.txt
apply_pdbaltpath_pdb_for_all_targets() |
Moved from https://svn.boost.org/trac10/ticket/13529
The text was updated successfully, but these errors were encountered: