Debug Break on Win32 Api functions

后端 未结 2 1401
深忆病人
深忆病人 2020-12-30 10:36

I would like to have a break on the SetTimer function in order to see which components register what timers with what values. Is this possible?

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 11:13

    Here's a walkthrough, with screenshots, for VS2005. Note that for VS2008+ you don't need to input decorated function names (perhaps that's the reason the previous description didn't work out directly? What's your platform/IDE ?).

    [Edit:] You definitely need public MS symbols to be able to locate Win32 API in binaries. The shortest route there is go to Tools/Options/Debugging/Symbols, then paste 'http://msdl.microsoft.com/download/symbols' into 'pdb locations'. It is highly recommended - but not necessary - to set a local cache for downloaded pdb's (first pdb loads can be a few minutes), and for your needs you should probably uncheck 'Search the above locations only when symbols are loaded manually'. There'd be some startup delay as all symbols are loaded, but you won't have to chase down user32.dll (or whatever dll holds the function you wish to break at) and load its pdb manually.

提交回复
热议问题