1
votes

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
target remote | expect_script sounds like a good solution. The expect script, after negotiating the connection, would probably have an interact statement. Is that what you have?Mark Plotnick
yes that is how I had writtenJegan
Sending packet: $Hc-1#09...Sending packet: $Hc-1#09...Timed out. Timed out. Timed out. Ignoring packet error, continuing... Sending packet: $qC#b4...Sending packet: $qC#b4...Sending packet: $qC#b4...Sending packet: $qC#b4...Packet received: OK Sending packet: $qOffsets#4b...Nak Sending packet: $qOffsets#4b...Ack Packet received: OK Malformed response to offset query, OK (gdb)Jegan

1 Answers

1
votes

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