# Setting breakpoints in user mode (including delay-loaded modules)

This section explains how to set breakpoints in user-mode applications using WinDbg, including cases where the target module (DLL) is delay-loaded using APIs like LoadLibrary. These scenarios are common in plugin-based apps or graphics-intensive games, where the module is not loaded at startup.

Delay-loaded modules are challenging for the following reasons:

- The DLL is not loaded when the process starts.
- You cannot set breakpoints in functions from that DLL until it is loaded.
- WinDbg cannot resolve symbols for unloaded modules.

Attention

For the following instructions, assume that you are debugging a console app called `FakeEditor.exe` that delay-loads a plugin DLL (`FakePlugin.dll`) using LoadLibrary, and that you want to break at `FakePlugin!pluginInit`.

To set breakpoints in a user-mode application using WinDbg, do the following:

1. Launch the app in WinDbg. For example:

debug-windbg-process-server copywindbg FakeEditor.exe
        Copy to clipboard
2. Wait for the initial breakpoint. WinDbg will break at `ntdll!LdrpDoDebuggerBreak`.
3. Set a breakpoint on module load. For example:

sxe ld FakePlugin
        Copy to clipboard

    This tells WinDbg to break when `FakePlugin.dll` is loaded.
4. Enter `g` to continue execution. WinDbg breaks again when `FakePlugin.dll` is loaded.
5. Enter the following to verify symbol loading:

lmDvm FakePlugin
        Copy to clipboard
6. Ensure that the symbols are loaded correctly. If not, use the following:

.reload /f /i FakePlugin
        Copy to clipboard
7. Use `bu` to set the breakpoint in the newly loaded module as in the following example.

bu FakePlugin!pluginInit
        Copy to clipboard
8. To verify that you set the breakpoint, use `bl` to list the breakpoints. You should see the breakpoint listed and enabled.
9. Enter the command `g` to continue the program execution.

    WinDbg breaks at `FakePlugin!pluginInit` when the function is called.

## Tips

- Use `!sym noisy` to troubleshoot symbol loading.
- Use `dx` to inspect variables and objects in WinDbg Preview.
- Always verify the correct process and thread before setting breakpoints.
- For Windows Store apps, ensure you launch WinDbg with the appropriate permissions and paths.

Last Published: Jun 16, 2026

[Previous Topic
Remote debugging](https://docs.qualcomm.com/bundle/publicresource/80-62010-1/topics/debug-windbg-process-server.md) [Next Topic
Symbol loading](https://docs.qualcomm.com/bundle/publicresource/80-62010-1/topics/debug-symbol-loading.md)