我想从我的主机盒调试远程盒子上运行的进程(我在主机上构建了代码).两者都有linux类型的操作系统.
我似乎只能通过ssh(我使用telnet测试)从主机盒与远程盒通信.
我已按照以下步骤进行设置:
在远程框上:
停止防火墙服务:
service firewall_service stop
将进程附加到gdbserver
--attach:remote_port process_id
在主机框上:
通过ssh设置端口转发
sudo ssh remote_username @ remote_ip -L host_port:localhost:remote_port -f sleep 60m
设置gdb以附加到远程进程:
gdb file.debug
(gdb)target remote remote_ip:remote_port
当我尝试通过在主机框上运行'target remote remote_ip:remote_port'来启动主机上的调试时,我收到"连接超时"错误.
你们可以看到我做错了什么,要检查什么或者通过ssh远程调试的替代方法我将不胜感激.谢谢