Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

docker

qemu

gdb

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!

like image 890
yiwanmian Avatar asked Nov 23 '25 10:11

yiwanmian


1 Answers

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

like image 171
Peter Maydell Avatar answered Nov 26 '25 14:11

Peter Maydell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!