Put breakpoint on named function
Is there a way to put a breakpoint on any functio开发者_开发百科n in Visual Studio, sort of like bm kernel32!LoadLib*
in WinDbg?
I know one way is to break at application start, find the required DLL load address, then add offset to required function you can get via Depends, and create a breakpoint on address. But that's really slow, and switching to WinDbg and back is also pretty annoying.
Maybe there is a better way?
Go to "Debug / New breakpoint / Break at function..." and paste the function name.
For APIs, this can be tricky, as the name of the function as seen by the debugger is different from its real name.
Examples:
{,,kernel32.dll}_CreateProcessW@40
{,,user32.dll}_NtUserLockWindowUpdate@4
See this blog post to find the right name: Setting a Visual Studio breakpoint on a Win32 API function in user32.dll
精彩评论