문제

Is there a way to put a breakpoint on any function 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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top