我試圖設置遠程調試與LLDB 4.0.1。 有一個docker(17.06.0-ce)容器與Arch linux。 碼頭集裝箱設置在privileged mode,所以現在LLDB可以在容器中啓動。 容器包含Rust可執行文件的core_service。遠程LLDB調試 - 碼頭集裝箱
命令內側容器運行 (lldb) target create target/debug/core_service Current executable set to 'target/debug/core_service' (x86_64). (lldb) process launch Process 182 launched: '/srv/core_service/target/debug/core_service' (x86_64)
問題的遠程調試,LLDB-服務器內側容器開始使用lldb-server platform --server --listen 0.0.0.0:1234
存在。 我可以從主機lldb連接到容器lldb-server,但我無法附加/創建進程。
命令在主機上運行(在容器LLDB服務器=本地主機:1234) (lldb) platform select remote-linux Platform: remote-linux Connected: no (lldb) platform connect connect://localhost:1234 Platform: remote-linux Triple: x86_64-*-linux-gnu OS Version: 4.12.4 (4.12.4-1-ARCH) Kernel: #1 SMP PREEMPT Fri Jul 28 18:54:18 UTC 2017 Hostname: 099bd76c07c9 Connected: yes WorkingDir: /srv/core_service (lldb) target create target/debug/core_service Current executable set to 'target/debug/core_service' (x86_64). (lldb) process launch error: connect remote failed (Connection refused) error: process launch failed: Connection refused
我怎樣才能解決這個問題?是否有任何碼頭,拱Linux設置會導致此錯誤?
看來,像docker容器中的lldb-server權限存在一些問題。
在主機上運行的命令(容器中的lldb服務器) (lldb) platform shell ps -A PID TTY TIME CMD 1 ? 00:00:00 bash 9 ? 00:00:00 nginx 10 ? 00:00:00 nginx 11 ? 00:00:00 lldb-server 25 ? 00:00:00 core_service 59 ? 00:00:00 lldb-server 68 ? 00:00:00 ps (lldb) platform shell kill -9 25 (lldb) platform process launch target/debug/core_service error: connect remote failed (Connection refused) error: Connection refused (lldb) platform process launch anything error: connect remote failed (Connection refused) error: Connection refused
但我找不出它是什麼。 lldb-server在容器中以root身份運行,我可以使用lldb執行shell命令。
嘗試增加'--cap加= ALL'還,看看是否有幫助?我不知道它會,但只是萬一它 –
@TarunLalwani我嘗試了'--cap-add = ALL',但仍然有同樣的問題。 – Adiqq
看看我的最新答案是否有幫助 –