[lldb-dev] Remote debugging - unix socket and/or specific port

2016-06-22 Thread Adrien Duermael via lldb-dev
Hi, 

I’ve been trying to run lldb-server from within a linux container lately. 

When I try to attach from outside the container using lldb command, most steps 
are successful but I can’t launch the process:

platform select remote-linux 👍
platform connect connect://IP:PORT 👍
target create main 👍
process launch ❌

My guess is that the container only exposes the control port, the one I’m 
listening to with lldb-server p --listen *:PORT.
And it seems that ports are dynamically allocated to then handle process 
debugging. 

I don’t want my container to expose too many ports, as I usually have in fact 
only one debuggable process running inside.
(I tried, I can launch my process if the container exposes all ports)

Is there a way to set a range for these dynamically allocated ports using 
lldb-server?

I can’t find it in the docs, and help command can’t help me either:
Usage:
  lldb-server p [--log-file log-file-name] [--log-channels log-channel-list] 
[--port-file port-file-path] --server --listen port

Also, is there an option to use unix sockets instead of ports?

Thanks for your help!

- Adrien Duermael



___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] Remote debugging - unix socket and/or specific port

2016-06-22 Thread Adrien Duermael via lldb-dev
Hi, 

I’ve been trying to run lldb-server from within a linux container lately. 

When I try to attach from outside the container using lldb command, most steps 
are successful but I can’t launch the process:

platform select remote-linux 👍
platform connect connect://IP:PORT  👍
target create main 👍
process launch ❌

My guess is that the container only exposes the control port, the one I’m 
listening to with lldb-server p --listen *:PORT.
And it seems that ports are dynamically allocated to then handle process 
debugging. 

I don’t want my container to expose too many ports, as I usually have in fact 
only one debuggable process running inside.
(I tried, I can launch my process if the container exposes all ports)

Is there a way to set a range for these dynamically allocated ports using 
lldb-server?

I can’t find it in the docs, and help command can’t help me either:
Usage:
  lldb-server p [--log-file log-file-name] [--log-channels log-channel-list] 
[--port-file port-file-path] --server --listen port

Also, is there an option to use unix sockets instead of ports?

Thanks for your help!

- Adrien Duermael___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Remote debugging - unix socket and/or specific port

2016-07-07 Thread Adrien Duermael via lldb-dev
Hi Pavel, 

Thanks for your answer! At least I know it’s not supposed to work as is. 
I’ll see if I can do something similar to what you guys did for Android 
platforms. 

Thanks again!

Cheers, 

- Adrien Duermael

> On Jun 29, 2016, at 5:07 AM, Pavel Labath  wrote:
> 
> Hi Adrien,
> 
> 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.
> 
> Unfortunately, there is no way to control this behavior at the moment. I 
> suppose you could unblock all ports on the container, but make sure that they 
> are only reachable from the host (I know that's not ideal).
> 
> cheers,
> pl
> 
> 
> On 22 June 2016 at 19:18, Adrien Duermael via lldb-dev 
> mailto:lldb-dev@lists.llvm.org>> wrote:
> Hi, 
> 
> I’ve been trying to run lldb-server from within a linux container lately. 
> 
> When I try to attach from outside the container using lldb command, most 
> steps are successful but I can’t launch the process:
> 
> platform select remote-linux 👍
> platform connect connect://IP:PORT <> 👍
> target create main 👍
> process launch ❌
> 
> My guess is that the container only exposes the control port, the one I’m 
> listening to with lldb-server p --listen *:PORT.
> And it seems that ports are dynamically allocated to then handle process 
> debugging. 
> 
> I don’t want my container to expose too many ports, as I usually have in fact 
> only one debuggable process running inside.
> (I tried, I can launch my process if the container exposes all ports)
> 
> Is there a way to set a range for these dynamically allocated ports using 
> lldb-server?
> 
> I can’t find it in the docs, and help command can’t help me either:
> Usage:
>   lldb-server p [--log-file log-file-name] [--log-channels log-channel-list] 
> [--port-file port-file-path] --server --listen port
> 
> Also, is there an option to use unix sockets instead of ports?
> 
> Thanks for your help!
> 
> - Adrien Duermael
> 
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org <mailto:lldb-dev@lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev 
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
> 
> 

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev