# on host
arm-linux-gnueabihf-gcc -g -o main main.c
scp main use@ip:/home/user
# on remote(arm)
# 172.25.115.195 is arm ip address
# 13000 is port to debug, can be any
cd /home/user
gdbserver 172.25.115.195:13000 main
# on host
arm-linux-gnueabihf-gdb main
target remote 172.25.115.195:13000
# set break point
gdb:b main
# continue to run
gdb:c
# read variable i
gdb:p i
gdb remote debuging from ubuntu to arm
该篇博客介绍了如何使用`gdbserver`在远程ARM设备(IP: 172.25.115.195)上调试C程序。首先,通过`arm-linux-gnueabihf-gcc`编译`main.c`,然后将编译后的程序传输到远程设备。接着,在远程设备上启动`gdbserver`监听特定端口。最后,在主机上使用`arm-linux-gnueabihf-gdb`连接远程设备并设置断点,进行远程调试。
摘要由CSDN通过智能技术生成