Is it possible to set breakpoints automatically (e.g. by regular expression) in VS2008?

核能气质少年 提交于 2019-12-11 00:39:34

问题


I would like to set breakpoints only at some kind of wrong behaviour hints (e.g. ERROR-trace macros, etc.) for being able to find possible errors early during development. So, I wonder if it is possible to set BPs at places in code found by regex? May-be using some scripting or automation features of VS.

Thank you for any hint!


回答1:


You can place a breakpoint on all overloaded versions of a method in Visual Studio using this trick : write the name of the method in the search box (main toolbar) and hit F9.

If you want more power, you can use WinDbg. The command bm (Set Symbol Breakpoint) allows pattern-matching expressions like this (see here for details):

0:000> bm myprogram!mem* 
   4: 0040d070 MyProgram!memcpy
   5: 0040c560 MyProgram!memmove
   6: 00408960 MyProgram!memset


来源:https://stackoverflow.com/questions/8641379/is-it-possible-to-set-breakpoints-automatically-e-g-by-regular-expression-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!