diff options
author | Silvino <silvino@bk.ru> | 2019-07-29 18:33:40 +0100 |
---|---|---|
committer | Silvino <silvino@bk.ru> | 2019-07-29 18:33:40 +0100 |
commit | ee84e47238980b2100d88f410d01fefcb7aa1d16 (patch) | |
tree | 56c6b628cab34f107d1d36a98cbc5d97ea5f3a63 /dev/c/debugging.html | |
parent | 79bfadccf36138b77df85621ae02ccbb39f45f8c (diff) | |
download | doc-ee84e47238980b2100d88f410d01fefcb7aa1d16.tar.gz |
fix dev c indexes
Diffstat (limited to 'dev/c/debugging.html')
-rw-r--r-- | dev/c/debugging.html | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/dev/c/debugging.html b/dev/c/debugging.html index c68fbc1..90dca1b 100644 --- a/dev/c/debugging.html +++ b/dev/c/debugging.html @@ -5,10 +5,43 @@ <title>Debugging</title> </head> <body> - <a href="../index.html">Development Index</a> + <a href="index.html">C Index</a> <h1>Debugging</h1> + <p>Check if the system have restrictions to attach to other processes or other hardening measures, check <a href=../../core/sysctl.html>sysctl settings</a> such as; kernel.yama.ptrace_scope;</p> + + <dl> + <dt>kernel.yama.ptrace_scope=0</dt> + <dd>All processes can be debugged, they must have same uid.</dd> + <dt>kernel.yama.ptrace_scope=1</dt> + <dd>Only a parent process can be debugged.</dd> + + <dt>kernel.yama.ptrace_scope=2</dt> + <dd>Require user privileges to use ptrace CAP_SYS_PTRACE capability.</dd> + + <dt>kernel.yama.ptrace_scope=3</dt> + <dd>No processes may be traced with ptrace.</dd> + + </dl> + + <p>Before debug;</p> + + <pre> + # echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + # sysctl -w kernel.yama.ptrace_scope=0 + + </pre> + + <p>After debug;</p> + + <pre> + # echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope + # sysctl -w kernel.yama.ptrace_scope=1 + </pre> + + <h2 id="gdb">GDB</h2> + <p>If the program needs arguments you can set it;</p> <pre> @@ -74,8 +107,14 @@ break linespec thread threadno </pre> + <h2 id="strace">Strace</h2> + + <pre> + $ strace -c ./program -o ~/program.strace + </pre> + <pre> - strace -c ./program + $ strace -p 1337 -o ~/program.strace </pre> @@ -87,11 +126,11 @@ <a href="http://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_39.html#SEC40">Stopping and Starting</a> multi-thread programs</p> - <a href="../index.html">Development Index</a> + <a href="index.html">C Index</a> <p> This is part of the Hive System Documentation. - Copyright (C) 2018 + Copyright (C) 2019 Hive Team. See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a> for copying conditions.</p> |