通过终端服务器通过认证连接gdb客户端

通过终端服务器通过认证连接gdb客户端

本文介绍了通过终端服务器通过认证连接gdb客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做远程调试。我的GDB服务器按预期运行(在我的情况下,它在内核方面是KGDB)。 KGDB挂起以便GDB客户端可以连接。



我需要使用终端服务器和端口号来连接GDB客户端,因为我的设备通过终端服务器连接,实际情况下需要用户名和密码才能进入。



因此,只是做目标远程终端服务器:端口不能帮助连接,因为没有提供用户名和密码的方法。

如果我直接使用串口连接设备并尝试使用目标远程/ dev / ttyS0,则它按预期工作。

但我想调试更多通过终端服务器连接的设备。你能帮我解决这个问题吗?我也尝试命令目标remote | expect_script(它将尝试使用用户名和密码登录),我无法成功。建议我这样做的正确方法。

解决方案

它现在起作用了。


$ b

!/ usr / bin / expect



spawntelnet172.26 .26.183016



期望用户名:
发送sample \r
期望密码:
发送pass \r
期望身份验证完成
交互


I am trying to do remote debugging. My GDB server runs as expected (in my case it is KGDB in kernel side). KGDB hangs up well so that GDB client can connect.

I need to connect GDB client using terminal server and port number because my device is connected via terminal server in real case scenario where username and password are required to get in.

Hence just doing target remote terminal-server:port is not helping to connect because there is no method to supply username and password.

If I connect my device directly with serial port and try with target remote /dev/ttyS0, it works as expected.

But I want to debug more devices which are connected through terminal server. Can you help me to solve this issue? I also try the command target remote | expect_script (which will try to login with username and password), I couldn't succeed. Suggest me right way of doing this.

解决方案

It worked now. I wrote expect script like this.

!/usr/bin/expect

spawn "telnet" "172.26.26.18" "3016"

expect "Username: "send "sample\r"expect "Password: "send "pass\r"expect "Authentication Complete"interact

这篇关于通过终端服务器通过认证连接gdb客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 08:59