It looks like I have some sort of permissions problem with kubectl. I have a Docker image, that contains server with native dynamic library + gdbserver. When I'm trying to debug Docker container running on my local machine all is fine. I'm using the following workflow:
- start gdb
- target remote | docker exec -i CONTAINER gdbserver - --attach PID
- set sysroot /path/to/local/binary
- Good to go!
But when I'm trying to do such operation with kubectl I'm getting the following error:
Cannot attach to lwp 7: Operation not permitted (1) Exiting Remote connection closed
The only difference is step 2:
target remote | kubectl exec -i POD -- gdbserver - --attach PID
kubectl exec -it POD bashand thengdbserver --attach. This will make debugging easier for you. - igniteCannot attach to lwp 7: Operation not permitted (1)- vglazkov