代码之家  ›  专栏  ›  技术社区  ›  Steve Dunn supercat

在VisualStudio调试器中,可以查看以“$”开头的特殊“变量”。它们是什么?

  •  2
  • Steve Dunn supercat  · 技术社区  · 14 年前

    void foo()
    {
        try
        {
            throw new Exception(@"whatever");
        }
        catch
        {
            int n=1; //put a breakpoint here
        }
    }
    

    当调试器在catch块的行上时,键入 $exception

    还有吗?这些是什么东西?似乎没有关于它们的正式文件。我用过 $例外 很长一段时间,但希望有其他人,例如,将显示 return value of a method .

    2 回复  |  直到 8 年前
        1
  •  2
  •   the_mandrill    14 年前

    更多特殊变量如中所述 this article . 还有一个 comprehensive list windbg中可用的变量数量-不确定VisualStudio中支持多少个

        2
  •  3
  •   Crippledsmurf    14 年前

    这些是调试器为方便您而创建的变量。如果使用立即窗口,则会得到类似的变量: int x = 10;

    会在本地窗口中产生x美元