--- title: 社課共筆 - C/GDB description: tags: - 社課 - 共筆 - 113 學年 --- :::success # 社課共筆 - C/GDB **時間:** 2025/03/13(星期四)18:00~20:00 **地點:** 挺生大樓 A3-200 教室 **簡報:** [連結](https://github.com/yuto0226/gdb_tutorial/blob/main/gdb.pdf) **Slido:** [連結](https://app.sli.do/event/2yR677sxAfZJW7m6dTotYa) ::: ## 環境設定 推薦還是在 Linux 系統上進行實驗([Ubuntu](#Ubuntu))。 - Editor: [VSCode](https://code.visualstudio.com/)、Vim、Neovim - Compiler: gcc - Debugger: gdb >[!Note] >如果自己設定遇到很多磨難,禮拜三下課可以到社辦找我。 >>結果我去系烤了 ### Ubuntu ```shell sudo apt update sudo apt upgrade sudo apt install git gcc vim ``` >[!Tip] >如果想要漂亮的 Linux 終端機,我有寫好設定檔,上課沒辦法帶完,但有興趣可以下載玩玩看。 >https://github.com/yuto0226/.dotfile ### Windows 在 Windows 系統上設定有兩個選項: - [WSL](https://learn.microsoft.com/zh-tw/windows/wsl/)(Windows Subsystem for Linux) - [Chocolatey](https://chocolatey.org/install) 安裝需要的套件 >[!Tip] >在使用 Windows 的終端機(PowerShell、CMD),推薦安裝 Windows Terminal 以獲得更好的使用體驗。 >https://learn.microsoft.com/zh-tw/windows/terminal/install #### WSL 基本上依照官方的[說明文件](https://learn.microsoft.com/zh-tw/windows/wsl/)安裝即可。 安裝完畢後依照 [Ubuntu](#Ubuntu) 的安裝說明操作即可。 打開 powershell: ```shell wsl --install Ubuntu ``` #### Chocolatey 接下來的安裝過程都需要具**管理員權限**的 PowerShell,可以在搜尋欄搜尋 PowerShell 然後用系統管理員開啟。  接著先執行以下指令解除執行限制: ```shell Set-ExecutionPolicy AllSigned ``` 接著下載並安裝 Chocolatey,輸入: ```shell Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) ``` 安裝完畢後可以檢查 `choco` 的版本,確認安裝完成: ```shell choco -v ``` 接著安裝這次課程需要用到的軟體: ```shell choco install git vim mingw ``` ### 簡報 & Labs 簡報和 Labs 的程式碼都放在 GitHub 上供大家下載: ```shell git clone https://github.com/yuto0226/gdb_tutorial.git cd gdb_tutorial ``` 社課開始前,要記得更新一下簡報和 Labs: ```shell cd gdb_tutorial git fetch ``` ## 程式碼編譯與執行 1. 前處理器 2. 編譯器 3. 組譯器 4. 鏈結器 GCC (GNU Compiler) ###
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up