Re: KDevelop - Attach debugger to a running process

Jonathan Verner <[email protected]>
Newsgroups gmane.comp.kde.devel.kdevelop
Message-ID <2149438.ElGaqSPkdT@cirdan>
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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.