将自定义函数标记为切换(Marking custom functions as step-over)

当我按下F8时,我有一些调试器不应该插入的功能。

例如,我有一个这样的子

DoSomething(DoThis(), DoThat())

现在,当我在这一行中设置了一个中断点时,我按F8,我想调试器不要进入“DoThis”,但它应该进入“DoThat”。

有没有办法以这样的方式标记特定的函数,以至于调试器会跳过它?

I have some functions that the debugger should not step into when I press F8.

For example, I have a sub like this

DoSomething(DoThis(), DoThat())

Now when the I set a break point in this line, and I press F8, I would like to the debugger to NOT step into "DoThis", but it should step into "DoThat".

Is there a way to mark specific functions in a such a way that the debugger will skip stepping into it?

最满意答案

您可以像这样给它调试DebuggerStepThrough属性

<System.Diagnostics.DebuggerStepThrough()> Private Sub DoThis() ... End Sub

You can just give it the DebuggerStepThrough attribute like this

<System.Diagnostics.DebuggerStepThrough()> Private Sub DoThis() ... End Sub将自定义函数标记为切换(Marking custom functions as step-over)

当我按下F8时,我有一些调试器不应该插入的功能。

例如,我有一个这样的子

DoSomething(DoThis(), DoThat())

现在,当我在这一行中设置了一个中断点时,我按F8,我想调试器不要进入“DoThis”,但它应该进入“DoThat”。

有没有办法以这样的方式标记特定的函数,以至于调试器会跳过它?

I have some functions that the debugger should not step into when I press F8.

For example, I have a sub like this

DoSomething(DoThis(), DoThat())

Now when the I set a break point in this line, and I press F8, I would like to the debugger to NOT step into "DoThis", but it should step into "DoThat".

Is there a way to mark specific functions in a such a way that the debugger will skip stepping into it?

最满意答案

您可以像这样给它调试DebuggerStepThrough属性

<System.Diagnostics.DebuggerStepThrough()> Private Sub DoThis() ... End Sub

You can just give it the DebuggerStepThrough attribute like this

<System.Diagnostics.DebuggerStepThrough()> Private Sub DoThis() ... End Sub