Has there been any change in this since reported here :
It is pretty clear that that the remote-linux platform is trying to open additional ports to talk to lldb-server, and if that server is in a container we need to expose them. But what ports, how many, how to specify? All uncertain.
Looking at the source shows there are some (undocumented?) port commands in lldb-server platform, I’m wondering if this is a solved problem that just doesn’t have an easy-to-search-for solution.
BTW, I may be barking up the wrong tree. I am using lldb on the host and lldb-server on the remote, so the gdb-server protocol shouldn’t be in play, at least I don’t think so.
But the problem I see in this configuration sure looks to be one of ports being firewalled.
>I think your diagnosis is correct here. LLDB does indeed create an
>additional connection to the gdb-server instance which is started by the
>platform instance when you start debugging. In case of android platforms we
>already include code to forward this port automatically, but there is no
>such thing for linux -- we just expect the server to be reachable.
A quick look at PlatformPOSIX.cpp, PlatformLinux.cpp and PlatformRemoteGDBServer.cpp shows that Pavel’s description of port forwarding situation is still accurate. On Linux currently there is no way to know the port number before LLDB tries actually attach to something.
Mentioning of GDB server protocol shouldn’t confuse you, it’s just a name of a text protocol LLDB client uses to talk to LLDB server . LLDB tries to be compatible with GDB in this aspect.
> To: email@example.com
> Date: 24/07/2017 16:19
> Subject: [lldb-dev] Remote debugging - unix socket and/or specific port
> Sent by: "lldb-dev" <firstname.lastname@example.org>
> Has there been any change in this since reported here :
> It is pretty clear that that the remote-linux platform is trying to
> open additional ports to talk to lldb-server, and if that server is
> in a container we need to expose them. But what ports, how many, how
> to specify? All uncertain.
> Looking at the source shows there are some (undocumented?) port
> commands in lldb-server platform, I'm wondering if this is a solved
> problem that just doesn't have an easy-to-search-for solution.
There's another thread here:
where I had an issue connecting to a remote lldb-server process on a particular port.
As part of that I was using options to tell lldb-server what ports to use. (I submitted a fix for the connection issues but the options code was written by someone else.)
There's some examples of the options in that thread but I did have a summary in my own archives:
Option (short and long forms) Purpose
--port-offset <port>, -p <port> Specify an offset to return to the port number returned for a new process.
--gdbserver-port <port> -P <port> Return the specified port number when a process is started. (Can specify multiple ports to use using more than one, e.g. -P 1024 -P 2048 )
--min-gdbserver-port <port> -m <port> Return a port number equal to or greater than the specified port number when a process is started.
--max-gdbserver-port <port> -M <port> Return a port number less than the specified port number when a process is started.
I hope that helps,
IBM Runtime Technologies, IBM Systems
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU