Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/cpp/cpp-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,13 @@ Windows:

Linux:

* GDB needs elevated permissions to attach to a process. When using *attach to process*, you need to provide your password before the debugging session can begin.
* You may see an error saying: `ptrace: Operation not permitted`. This is due to GDB needing elevated permissions in order to attach to a process. This can be solved using the solutions below:
1. When using *attach to process*, you need to provide your password before the debugging session can begin.
1. To disable this error temporarily, use the following command:

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

1. To remove the error permanently, add a file called `10-ptrace.conf` to `/etc/sysctl.d/` and add the following `kernel.yama.ptrace_scope = 0`.

macOS:

Expand Down