changed 3 years ago
Published Linked with GitHub
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

sshpass -p 為自動輸入 sudo passowrd

在Post build 加上此 command

新增Debug 組態

選擇 C/C++ Remote Application

選擇 GDB debugger

Debugger -> GDB debugger -> Debugger Options -> Main Tab:

/opt/lnxshare/aarch64-buildroot-linux-gnu_sdk-buildroot/bin/aarch64-linux-gdb

選擇 Connection

Debugger -> GDB debugger -> Debugger Options -> Connection:

Server (target)配置

配置網路(已配置可略過):

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

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

Select a repo