warning: GDB: Failed to set controlling terminal: Operation not permitted
斷點不生效、無法調試。
gnome-terminal -t $TITLE -x 可能缺少權限啟動控制終端。Settings → Debugger → Default 分頁。
xterm -T $TITLE -e
// 或
konsole --title $TITLE -e
// 或
xfce4-terminal -T $TITLE -x
視桌面環境安裝對應終端機(sudo apt install xterm 等)。
Project → Properties → Build targets → Debug 勾選 Pause when execution ends。Settings → Environment → General → Terminal to launch console programs 留空,讓 CB 直接在內建日誌視窗運行(無法互動輸入)。
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
// 永久生效編輯 /etc/sysctl.d/10-ptrace.conf
kernel.yama.ptrace_scope = 0
sudo sysctl -p
Code::Blocks 13.12 較舊,建議遷移至現代 IDE(VS Code、CLion、Qt Creator)獲得更穩定的調試體驗。