###### tags: `Linux` # Eclipse 使用 Gdb server DEBUG ## Scp test ``` echo test > scptest scp scptest root@192.168.0.33:/home/psx ``` ## Eclipse 配置 - Systax: ``` sshpass -p <password> scp ${ProjName} <ssh path> ``` - example ``` sshpass -p "psx" scp ${ProjName} root@192.168.0.33:/home/psx ``` :::info sshpass -p 為自動輸入 sudo passowrd ::: ### 在Post build 加上此 command ![](https://i.imgur.com/omw0tVC.png) ### 新增Debug 組態 ![](https://i.imgur.com/Fnr24Cb.png) ### 選擇 C/C++ Remote Application ![](https://i.imgur.com/1UUsJNW.png) ### 選擇 GDB debugger Debugger -> GDB debugger -> Debugger Options -> Main Tab: ```s= /opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-gdb ``` ![](https://i.imgur.com/75SKTBv.png) ### 選擇 Connection Debugger -> GDB debugger -> Debugger Options -> Connection: ![](https://i.imgur.com/Bk9WVSv.png) # Server (target)配置 配置網路(已配置可略過): ```s= echo "iface eth0 inet dhcp" >> /etc/network/interfaces echo -e "iface eth0 inet dhcp\n address 192.168.56.20\n netmask 255.255.255.0\n gateway 192.168.169.1" >>/etc/network/interfaces ``` ## 安裝 gdbserver ``` TBD. ``` ## 執行 command ```s= gdbserver :3345 <yourappname> ``` ref: https://zh-tw.coderbridge.com/discussions/2ab8f02fd9804d7198ab1d7578ae7454 https://www.eet-china.com/mp/a54821.html https://www.youtube.com/watch?v=MfdLFKMU4Lw https://stackoverflow.com/questions/20870338/how-to-terminate-gdbserver