Debug with WinDbg
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
Azure Artifacts provides a dedicated symbols server for publishing symbols. This server allows you to connect a debugger that can automatically fetch the correct symbol files, enabling you to debug your application efficiently. With tools like WinDbg, you can load an executable, attach the debugger to a running process, consume your symbols, set up breakpoints, and systematically analyze your code.
Add symbol server to WinDbg
To use the Azure Artifacts symbol server, you must add your organization to the symbols search path, but before we can do that, we must first create a personal access token.
Create a Personal Access Token with Symbols (read) scope and copy it to your clipboard.
Open WinDbg, or install it if you haven't already.
Select File, and then select OpenExecutable to load the executable you wish to debug.
Run the following command to set the symbols path. Replace the placeholder with your specific organization name:
.sympath+ https://artifacts.dev.azure.com/<ORGANIZATION_NAME>/_apis/symbol/symsrv
Set a breakpoint by running the bp command. this will trigger a symbols request.
During the authentication prompt, insert the personal access token you generated earlier. You can leave the username field empty. WinDbg will proceed to obtain the symbols for your executable.
To verify if your symbols are loaded, run the lm command to list all loaded modules.
Start debugging
WinDbg enhances the scope and versatility of debugging, enabling effective troubleshooting of components in both user-mode and kernel-mode:
- Get started with Windows debugging
- Get started with WinDbg (user-mode)
- Get started with WinDbg (kernel-mode)
- Use the WinDbg Graphical Interface (Classic)
- Use the Debugger Commands