--- tags:tutorial disqus:hackmd --- xDIVA使用教學 === **[English Version]()** - [回到使用教學頁面]() 快速上手 --- - [Install VS Code](https://code.visualstudio.com/) - [Install Mingw-w64, GCC for Windows](https://tinyurl.com/rbjxu6p) ![Mingw install](https://i.imgur.com/XZUqbeE.png) when installing, choose the x86_64 architecture instead of i686 - Make sure that setting global environment variables, e.g., "c:\mingw-w64\mingw64\bin" on Windows after the installation. - [Install xDIVA](https://drive.google.com/file/d/1cwQXPckPcyzsf7WLBOdmFTnmJBw3gRM_/view?usp=sharing) - [視覺化第一個程式碼範例](/@xDIVA/first-example) GDB-plugin 使用介紹 --- 1. 在 VS Code 中打開程式碼,並使用 Ctrl+\` 打開終端機 2. 在終端機中執行以下指令編譯程式 ``` g++ -g yourSrcCode.cpp ``` 3. 接下來執行以下這個指令 ``` python C:\xDiva\xDiva2.0-GdbPlugin\xdiva.py ./a.exe ``` 4. 接著會進入 gdb 的操作介面,利用 break 指令在特定行數下中斷點後便可執行程式 ``` >break 10 >run ``` Watch Dialog 使用介紹 --- 1. 開啟桌面上的 ![](https://i.imgur.com/akT14FU.png) xDIVA主程式,需注意的是 gdb 必須有 run 程式以及 viewer 必須打開,watch dialog 才能正常連線 2. 畫面如下 ![](https://i.imgur.com/6rjfbxb.png) 3. 基本功能介紹 - ![](https://i.imgur.com/IZ5Xydt.png) new action file 建立一個新的觀察變數頁面 - ![](https://i.imgur.com/lyW2GBU.png) load action file 從一個已被儲存的action file讀取內容 - ![](https://i.imgur.com/5ObPZsY.png) 儲存目前狀態為一個新的 action file - ![](https://i.imgur.com/nmH4MSD.png) 查看過去的所執行的動作 - ![](https://i.imgur.com/OjhGc3X.png) 在 GDB 下了中斷點後執行 continue 命令 - ![](https://i.imgur.com/Kyq0fYh.png) 執行 step into 命令 - ![](https://i.imgur.com/9x2tFqu.png) 執行 step over 命令 - ![](https://i.imgur.com/YWZ04I2.png) 抓取目前程式執行中的變數資料 - ![](https://i.imgur.com/q0mEhgf.png) 將以擷取的物件做視覺化的動作(Type Mapping)