skip to Main Content

I use Docker to run Debian(arch is ARM64) container and my host machine is x86_64. When use GDB for debuging files, I get this erro:

warning: Could not trace the inferior process.
Error:
warning: ptrace: Function not implemented
During startup program exited with code 127.

And I have add –privileged to my container, I also get this problem. Container’s arch is x86_64 with host arch is x86_64 is ok.
In other question, someone say is about to qemu not support ptrace.Anyone can solve this problem. Thanks!

2

Answers


  1. You can’t run an emulated gdb inside QEMU’s usermode emulation. Instead you need to run a gdb built for your host architecture but with support for debugging executables for your guest architecture, and connect that to QEMU’s builtin gdbstub. See also this answer: https://stackoverflow.com/a/28241508/4499941

    Login or Signup to reply.
  2. solution: https://github.com/docker/for-mac/issues/5191

    stephen-turner commented on May 7, 2021
    Closing this ticket. @cpuguy83 has explained (#5191 (comment)) why it cannot work. qemu emulation is only ever best-effort: the solution is to run arm64 containers on M1 hardware.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search