Conditional Breakpoints on Call Stack

后端 未结 2 1191
谎友^
谎友^ 2021-02-01 06:50

Is it possible to specify a breakpoint in Visual Studio 2010 that hits only if the calling methods up the call stack meet some specific condition? For example, and most likely,

2条回答
  •  粉色の甜心
    2021-02-01 07:14

    The StackTrace class should give you what you need.

    StackTrace stackTrace = new StackTrace();           
    StackFrame[] stackFrames = stackTrace.GetFrames(); 
    

提交回复
热议问题