zoukankan      html  css  js  c++  java
  • Debug

    1.Error List;
    2.Output: Debug.WriteLine() Trace.WriteLine():诊断输出
    Debug.WriteLine("Added 1 to i","MyFunc");//第二个参数为类别,可不写。
    输出:MyFunc:Added 1 to i
    条件Output:Debug.WriteLineIf();
    Trace.WriteLineIf();
    Debug.WriteIf();
    Trace.WriteIf();

    3.写入日志文件:
    4.跟踪点调式:breakpoint | insert tracepoint (when breakpoint is hit :print a message: 要输出 的字符串)
    message会在output中显示。
    5.中断模式:
    Debug->windows下,可添加不同的debug窗口。
    工具栏Pause暂停,断点:(breakpoint tracepoint)Hit count ,Condition

    Debug.Assert()
    Trace.Assert()
    它们有3个参数
    Debug.Assert(myVar<10,"myVal is 10 or greater","Assertion occurred in Main().");
    参数:1:bool ,false 触发 2:字符串,提供错误描述 3;字符串,提供下一步如何操作。
    两个字符串分别把信息写到对话框和output窗口。

    6。监视变量的内容
    Autos(当前使用的变量和前面的语句),Locals(作用域内所有变量),Watch N(可定制变量 和表达式(N(1-4)))

    7。单步执行:
    Step into F11,Step Over F10,Step Out Shift F11(跳出当前函数或下一下断点)

    8。Immediate Command
    命令:immed :Command->Immediate
    >cmd Immediate->Command
    Immediate:
    such as:testArray[0]*10 回车查值;
    testArray[0]+=9 可修改所查的值。

    9。Call Stack
    显示 函数列表(当前函数,调用它们的函数)
    双击它们会跳到相应位置。
    10。异常处理
    try
    {}
    catch(System.IndexOutOfRangeException e)
    {

    }
    catch
    {
    throw(new System.Exception());
    }
    finaly
    {}
    Exceptions菜单勾选exception;Ctr + Alt +E

    下级try catch 中的catch 中的异常由上级try catch 处理;

  • 相关阅读:
    通用人工智能离我们还有多远?
    自动化机器上的物联网网关的目的是什么?
    提效降本,您不可不知道的云架构秘诀
    “影子物联网”:日益增长的企业安全盲区
    查找练习 hash——出现过的数字
    查找练习 hash——出现过的数字
    数据结构上机实验之二分查找
    数据结构上机实验之二分查找
    简单字符串比较
    简单字符串比较
  • 原文地址:https://www.cnblogs.com/zhubenxi/p/5296113.html
Copyright © 2011-2022 走看看