程式 file 執行檔名稱 fg 原始碼 list list - list 20,80 參數 show args set args -i /home/lantw44/z_exchange 查看 print 顯示變數值 whatis 查看資料類型 ptype 查看資料類型的定義 disas 反組譯附近記憶體中的程式 x 顯示記憶體位置的值 執行 bt 查看程式如何進入這個函式 (加上 full 可查看所有區域變數值) step 執行一行程式 next 執行一行程式,但不追蹤進入函式 stepi 執行一個機器指令 nexti 執行一個機器指令,但不追蹤進入函式 finish 等這個函式結束 return 立即 return 這個函式 訊號 info signals handle 訊號 選項 nostop 當接到這個signal時GDB 不要停止你的程式 stop 當接到這個signal時GDB 停止你的程式 print 當接到這個signal時GDB 印出這是什麼sginal noprint 當接到這個signal時GDB 不印出這是什麼sginal pass GDB pass這個signal給你的程式 (noignore) 也就是你的程式有能力處理這個siganl nopass GDB 不會讓你的程式看到這個signal (ignore) 中斷點 info breakpoints break FUNCTION break LINENUM break FILENAME:LINENUM break FILENAME:FUNCTION break *0x40065f (在此記憶體位置上設定中斷點) break (在目前位置設定中斷點) watch $r9 (暫存器) watch *0x40065f watch VARIABLE delete breakpoints 5 enable breakpoints 5 disable breakpoints 5