A happy (very late) #toolstuesday to all of you. This time a trick to break and attach the Visual studio debugger the moment a program starts on Windows.
using gflags (coming with Debugging Tools for Windows) https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags
- start gflags
- navigate to the Image file tab
- enter the executable name in the Image field and press tab
- check debugger and put in "vsjitdebugger.exe"
- click OK
- now everytime the program of given name starts the debugger selector will come up
#toolstuesday under the hood this sets some registry values and the windows OS program loader will start the given debugger. "vsjitdebugger.exe" is the Visual Studio Just In time debugger https://learn.microsoft.com/en-us/visualstudio/debugger/debug-using-the-just-in-time-debugger?view=vs-2022