> For the complete documentation index, see [llms.txt](https://jen-hsuan-hsieh.gitbook.io/debugging-tools-experience/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jen-hsuan-hsieh.gitbook.io/debugging-tools-experience/422chu-cuo-gong-ju/4221visual-studio/2214zhui-zong-dian.md).

# 5.1.4.追蹤點

## 1.用途

* 除了有中斷點的功能, 也可以在中斷時印出指定的訊息

## 2.用法

* 1.在想要中斷/印出訊息的地方, 按右鍵 -> breakpoint -> Insert Tracepoint ![](https://github.com/jenhsuan/debugging-tools-experience/tree/91ad7a157f155ea77065c5600800bb4627bd1ae2/assets/螢幕快照%202017-06-27%20上午8.57.28.png)
* 2.設定視窗
  * 這邊可以在輸入的地方輸入想要在output視窗印出的訊息, 可分為兩種:
    * 1.預設訊息種類
      * a.在輸入框中輸入**address: $ADDRESS, caller: $CALLER, stack:  $CALLSTACK, function: $FUNCTION, pid: $PID, pname: $PNAME, tid: $TID, tanme: $TNAME**, **取消Continue execution**並按下OK

        ```
          $ADDRESS: 當前指令的位置
          $CALLER: 上一層函式名稱
          $CALLSTACK: 當前的堆疊    
          $FUNCTION: 當前的函式名稱
          $PID: Process Id
          $PNAME: Process 名稱
          $TID: Thread Id
          $TNAME: Thread 名稱
        ```

        ![](https://github.com/jenhsuan/debugging-tools-experience/tree/91ad7a157f155ea77065c5600800bb4627bd1ae2/assets/螢幕快照%202017-06-27%20上午9.59.41.png)
      * b.DEBUG -> Start Debugging ![](https://github.com/jenhsuan/debugging-tools-experience/tree/91ad7a157f155ea77065c5600800bb4627bd1ae2/assets/螢幕快照%202017-06-27%20上午10.08.13.png)
      * c.檢視output視窗 ![](https://github.com/jenhsuan/debugging-tools-experience/tree/91ad7a157f155ea77065c5600800bb4627bd1ae2/assets/螢幕快照%202017-06-27%20上午10.14.32.png)
    * 2.區域變數
      * a.在輸入框中輸入變數, 並以中括號刮起來, 嘗試勾選**Continue execution**並按下OK

        ![](https://github.com/jenhsuan/debugging-tools-experience/tree/91ad7a157f155ea77065c5600800bb4627bd1ae2/assets/螢幕快照%202017-06-27%20上午10.17.57.png)
      * b.DEBUG -> Start Debugging
      * c.檢視output視窗

        ![](https://github.com/jenhsuan/debugging-tools-experience/tree/91ad7a157f155ea77065c5600800bb4627bd1ae2/assets/螢幕快照%202017-06-27%20上午10.20.53.png)
