Recommended debugger setup for Windows 10?

Hey all,

Newbie here, just setting up development workflow for the first time. I’m building with Visual Studio Community 22 on Windows 10. Curious what people would recommend for debugger workflow, for both C++ code and Python code? Mostly looking for a way to set breakpoints and step through code.

My current plan is to attach VS debugger to a debug build blender.exe. I’m falling flat on my face over an address sanitizer error when I start blender.exe though:

PS D:\yemount\blender-dev\build_windows_x64_vc17_Debug\bin\Debug> .\blender.exe
=================================================================
==25268==ERROR: AddressSanitizer: container-overflow on address 0x00631c3ff4a0 at pc 0x7ffdfd5d44db bp 0x00631c3ff480 sp 0x00631c3fec00
READ of size 8 at 0x00631c3ff4a0 thread T0
    #0 0x7ffdfd5d4508 in _asan_wrap_GlobalSize+0x4150f (D:\yemount\blender-dev\build_windows_x64_vc17_Debug\bin\Debug\clang_rt.asan_dbg_dynamic-x86_64.dll+0x180044508)
    #1 0x7ff7d129fa1e in boost::atomics::detail::bitwise_cast_memcpy<unsigned __int64,8,boost::filesystem::path const *> E:\db25\build\S\VS1564D\build\boost\src\external_boost\boost\atomic\detail\bitwise_cast.hpp:89
    #2 0x7ff7d129f832 in boost::atomics::detail::bitwise_cast<unsigned __int64,8,boost::filesystem::path const *> E:\db25\build\S\VS1564D\build\boost\src\external_boost\boost\atomic\detail\bitwise_cast.hpp:134
    #3 0x7ff7d129f872 in boost::atomics::detail::bitwise_cast<unsigned __int64,boost::filesystem::path const *> E:\db25\build\S\VS1564D\build\boost\src\external_boost\boost\atomic\detail\bitwise_cast.hpp:143
    #4 0x7ff7d12a17b1 in boost::atomics::detail::base_atomic_ref<boost::filesystem::path const *,void *,0>::compare_exchange_strong_impl E:\db25\build\S\VS1564D\build\boost\src\external_boost\boost\atomic\detail\atomic_ref_impl.hpp:1200
    #5 0x7ff7d12a1677 in boost::atomics::detail::base_atomic_ref<boost::filesystem::path const *,void *,0>::compare_exchange_strong E:\db25\build\S\VS1564D\build\boost\src\external_boost\boost\atomic\detail\atomic_ref_impl.hpp:1098
    #6 0x7ff7d12a20f2 in `anonymous namespace'::get_dot_dot_path E:\db25\build\S\VS1564D\build\boost\src\external_boost\libs\filesystem\src\path.cpp:1491
    #7 0x7ff7d129db68 in boost::filesystem::detail::dot_dot_path E:\db25\build\S\VS1564D\build\boost\src\external_boost\libs\filesystem\src\path.cpp:1688
    #8 0x7ff7d129b50b in boost::filesystem::path::extension_v3 E:\db25\build\S\VS1564D\build\boost\src\external_boost\libs\filesystem\src\path.cpp:562
    #9 0x7ff7bec60939 in `dynamic initializer for 'ccl::OIDNDenoiser::mutex_''+0xd009 (D:\yemount\blender-dev\build_windows_x64_vc17_Debug\bin\Debug\blender.exe+0x140080939)
    #10 0x7ffe004d4298 in initterm+0x58 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x180074298)
    #11 0x7ff7d143d038 in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:256
    #12 0x7ff7d143cf9d in __scrt_common_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:330
    #13 0x7ff7d143d1fd in mainCRTStartup D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:16
    #14 0x7ffeb9ea7033 in BaseThreadInitThunk+0x13 (C:\WINDOWS\System32\KERNEL32.DLL+0x180017033)
    #15 0x7ffeba5826a0 in RtlUserThreadStart+0x20 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x1800526a0)

Address 0x00631c3ff4a0 is located in stack of thread T0
HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0.

It’s been my experience that ASAN support in recent VS installs has been broken :frowning: I think they’re working on fixing it as I try to follow some of their bug reports. For now, you’ll have to do what the error says:

Or do not use the ASAN build option. You don’t need it to debug.

Gotcha. Setting the ASAN_OPTIONS env variable did the trick.
Once I could start the debug build, attaching debugger worked as expected :smiley:
Thanks for the help!