yiwanmian
yiwanmian

Reputation: 3671

warning: ptrace: Function not implemented During startup program exited with code 127

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!

Upvotes: 3

Views: 6877

Answers (2)

Charlie Parker
Charlie Parker

Reputation: 5201

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.

Upvotes: -1

Peter Maydell
Peter Maydell

Reputation: 11383

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

Upvotes: 1

Related Questions