1 回答

TA贡献1827条经验 获得超8个赞
您所追求的称为调用堆栈。
想象一下我们有这个程序:
public static class Program
{
private static int something;
public static void Main()
{
One();
Console.Read();
}
private static void Three()
{
something = 3;
Four();
}
private static void Four()
{
something = 4;
}
private static void Two()
{
something = 2;
Three();
}
private static void One()
{
something = 1;
Two();
}
}
假设我们有一个断点,Four()调试器停在那里,如果我们查看调用堆栈窗口,它将如下所示:
我们可以单击并转到调用堆栈历史记录中的任何点。最好的部分是,当您单击 时One()
,它将显示something
调用堆栈中该点的值;因此,尽管我们在其中Four()
并且 的值为something
4,但如果您跳转到One()
,该值将显示为零。
有关键盘快捷键,请参阅此线程。
- 1 回答
- 0 关注
- 204 浏览
添加回答
举报