I\'m trying to attach a program with gdb but it returns:
Attaching to process 29139 Could not attach to process. If your uid matches the ui
Not really addressing the above use-case but I had this problem:
Problem: It happened that I started my program with sudo, so when launching gdb it was giving me ptrace: Operation not permitted.
sudo
ptrace: Operation not permitted
Solution: sudo gdb ...
sudo gdb ...