V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Abmcar
V2EX  ›  程序员

如何在 M 系列的 Mac 上使用 x86 docker image 内的 lldb 调试容器内的 cpp 程序?

  •  
  •   Abmcar · 13 天前 · 626 次点击

    我在 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"]
    
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3436 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 04:35 · PVG 12:35 · LAX 21:35 · JFK 00:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.