Windbg: putting a break point on managed generic functions

Sometimes its not very straight forward to put breakpoints on generic functions or functions in generic classes. Typing the full class name correctly could be non trivial and frustrating. Here is something which I always follow:

Use method descriptors with bpmd instead. The syntax is !bpmd -md <method descriptor address> . Then the question is how to get the method descriptor address.

Use !dumpdomain – this will list all the modules in all application domains (most applications have only one appdomain).

Take the module name where your type exists and read the module address

!dumpmodule –mt <module address>

This will list the types in the module. Now pick up your types address and

!dumpmt –md <type address>

This will list all the method descriptor addresses of your type and this is what we need to put a break point.

!bpmd –md <method descriptor address>