Setup is a docker container running ubuntu 16.04, clang/lldb 6.0. I want to be able to remote debug an application, for now via another terminal instead of an IDE.
My docker file
FROM ubuntu:16.04
RUN apt update
RUN apt install -y curl git nano cmake build-essential xz-utils
RUN apt install -y clang-6.0 lldb-6.0
EXPOSE 2000
CMD [ "/bin/bash" ]
I spin my container as follows
docker run --privileged --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -it -v ~/Developer:/Developer -p 2000:2000 --name cpp-dev ubuntu-clang-dev
Debugging from within the container works
I can successfully compile and debug my program with clang++ and lldb when inside the container.
How I start my lldb-server
lldb-server-6.0 platform --server --listen *:2000
Now, from a separate terminal I do:
> lldb
> platform select remote-linux
> platform connect connect://localhost:2000
> target create test
> b main (which returns breakpoint main at main.cpp:5)
> process launch
Errors: (lldb) process launch error: connect remote failed (Failed to connect port) error: process launch failed: Failed to connect port
What am I doing wrong?