connect gdb client through terminal server with authentication

670 views Asked by At

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.

1

There are 1 answers

0
Jegan On

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