Search code examples
windbgbreakpoints

Windbg: add multiple unresolved breakpoints


I have an unloaded module for which I'd like to add unresolved breakpoints but I can't get it to work.

I have tried

  1. to use a wildcard as in bm. That doesn't seem to be supported

bu "RPS32!*"

  1. to explicitly name the methods but each breakpoint get's assigned id 0.This only sets the breakpoint for the last added.

bu "RPS32!RpsConvertBuffer"

bu "RPS32!RpsConvertFile"

  1. to explicitly name the methods and the id's. The id's don't seem to stick. Each breakpoint again just redefines id 0 and only the last added is actually set.

bu39 "RPS32!RpsConvertBuffer"

bu40 "RPS32!RpsConvertFile"

So my question is actually twofold:

  • Is it possible to have multiple unresolved breakpoints?
  • If it's possible, what is wrong with the syntax I'm using?

Solution

  • The chance of myself running into this same issue again is quite high so I'm pretty much answering my own question out of self interest.

    Remove the quoting around the methods


    Probably this is WinDbg Breakpoint syntax 101 but adding quotes around the method makes WinDbg

    • use the address of the current instruction to add an unresolved breakpoint
    • reusing Id 0
    • and interpreting what's between quotes as a command.

    Looking at the breakpoint list, that penny really should have dropped sooner

    (1e48.1c10): Break instruction exception - code 80000003 (first chance)
    eax=00000000 ebx=00000000 ecx=08160000 edx=0012e118 esi=fffffffe edi=00000000
    eip=77220ed4 esp=0025f93c ebp=0025f968 iopl=0         nv up ei pl zr na pe nc
    cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000246
    ntdll!LdrpDoDebuggerBreak+0x2c:
    77220ed4 cc              int     3
    0:000> bu "Unresolved1"
    0:000> bu "Unresolved2"
    breakpoint 0 redefined
    0:000> bl
         0 e Disable Clear  77220ed4     0001 (0001)  0:**** ntdll!LdrpDoDebuggerBreak+0x2c "Unresolved2"