KDevelop - Attach debugger to a running process

Jonathan Verner jonathan at temno.eu
Tue Apr 7 14:39:53 BST 2020


Hi,

the problem is that on most distributions, attaching a debugger to a running 
process is not allowed by default. See, e.g., https://stackoverflow.com/
questions/19215177/how-to-solve-ptrace-operation-not-permitted-when-trying-to-
attach-gdb-to-a-pro

As per the stackoverflow question, this can be solved by running

    $ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

or editing `/etc/sysctl.d/10-ptrace.conf`

It seems a good idea to mention this in the documentation. Perhaps kdevelop 
could also provide a more userfriendly message...

Cheers,

Jonathan

On pondělí 6. dubna 2020 18:55:25 CEST John Hayes wrote:
> Aleix, Sven,
> 
> Could you clarify the use of the Attach the Debugger to a running
> Process? I am working on that section in the KDevelop5 manual and I can
> attach to a running project with Heaptrack, but not with gdb or lldb.
> When I try with either debugger I get:
> 
> 	ptrace: Operation not permitted.
> 
> Am I doing something wrong, or is this due to linux kernel changes?






More information about the KDevelop-devel mailing list