【一】连上远端linux
1、设置

2、添加一个deployment

3、mapping设置

4、设置本地和远端代码实时同步

【二】linux端安装gdb和gdbserver
1、下载gdb源码
2、上传到linux的/tmp目录下并解压

3、在gdb-9.2下建立build目录

4、进入build目录并执行
./../configure --prefix=/tmp
make
make install
5、完成安装,安装的二进制放在/tmp/bin下

6、编出可执行文件并挂gdbserver调试
g++ -g a.cpp -o tmp
/tmp/bin/gdbserver :12345 ./tmp
【三】windows端新增一个gdbserver远端
1、新增gdb远程调试


2、调试吧

3、好不快活
需要等一会才能连上
然后你发现,啥都有了,地址,变量


网友评论