0

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!

yiwanmian
  • 911
  • 1
  • 6
  • 5

1 Answers1

0

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

Peter Maydell
  • 7,457
  • 1
  • 13
  • 17