c - How to solve "ptrace operation not permitted" when trying to attach GDB to a process?
I'm trying to attach a program with gdb but it returns:

If you are using Docker, you will probably need these options:
docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined

If you are using Podman, you will probably need its --cap-add option too:
podman run --cap-add=SYS_PTRACE

