我在 M 系列的 Mac 上,尝试通过 Docker 运行 x86_64 (amd64) 架构的 Linux 镜像,并在容器内用 LLDB 对程序进行调试。发现无论怎么配置(比如加上 --privileged 、--cap-add=SYS_PTRACE 、--security-opt seccomp=unconfined ),LLDB 都不可用,报错结果为
error: 'A' packet returned an error: -1
但是如果换成 aarch 的镜像就没有问题,可以正常使用 lldb ,有没有大佬知道是怎么回事?
测试用的 dockerfile
FROM --platform=linux/arm64 ubuntu:22.04
RUN apt update && apt install -y lldb clang
COPY hello.c /hello.c
RUN clang -g -o /hello /hello.c
CMD ["/bin/bash"]
FROM --platform=linux/amd64 ubuntu:22.04
RUN apt update && apt install -y lldb clang
COPY hello.c /hello.c
RUN clang -g -o /hello /hello.c
CMD ["/bin/bash"]
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.