How to connect "lldb-server" from GDB-client

Greetings!

Can you please suggest or workaround to connect to “lldb-server” from GDB-client?

Illustration:
On remote-host (e.g. from myhost):
$ lldb-server gdbserver localhost:2001 /a.out

and from client-host:
$ gdb /a.out
(gdb) target remote myhost:2000
myost::2000: Connection timed out. <<<

Appreciate if you can share how to make it work or any workaround.
Thank you.
-Hiral

Is it just a typo that you have the server running on port 2001, then connect to port 2000? The port needs to match on both sides.

localhost is not going to work if client-host is another machine. In that case you’ll want to use 0.0.0.0:<port> instead. (ip - What is the difference between 0.0.0.0, 127.0.0.1 and localhost? - Stack Overflow)

It’s possible the timeout is because one side sent something the other doesn’t understand. To debug that you’ll want to look at the packets sent. set debug remote 1 apparently does this for GDB, don’t have one to hand to check.

It was typo.
On Ubuntu I could connect as localhost:port, however getting Packet errors.
We can close this thread.
Thanks DavidSpickett.