From ee84e47238980b2100d88f410d01fefcb7aa1d16 Mon Sep 17 00:00:00 2001 From: Silvino Date: Mon, 29 Jul 2019 18:33:40 +0100 Subject: fix dev c indexes --- dev/c/basic.html | 4 ++-- dev/c/datatypes.html | 6 +++--- dev/c/debugging.html | 47 +++++++++++++++++++++++++++++++++++++++++++---- dev/c/elements.html | 6 +++--- dev/c/hello.html | 4 ++-- dev/c/index.html | 6 +++--- dev/c/lib.html | 6 +++--- dev/c/system.html | 6 +++--- 8 files changed, 62 insertions(+), 23 deletions(-) (limited to 'dev') diff --git a/dev/c/basic.html b/dev/c/basic.html index 104e59a..a2009fc 100644 --- a/dev/c/basic.html +++ b/dev/c/basic.html @@ -5,7 +5,7 @@ C - Basic - C & GDB Index + C Index

C - Basic

@@ -48,7 +48,7 @@ $ gcc -Wall main.c hello.c -o hello - C & GDB Index + C Index

This is part of the Hive System Documentation. Copyright (C) 2019 diff --git a/dev/c/datatypes.html b/dev/c/datatypes.html index 77b5dbb..a5e1efd 100644 --- a/dev/c/datatypes.html +++ b/dev/c/datatypes.html @@ -5,7 +5,7 @@ Datatypes - Development Index + C index

Datatypes

@@ -172,9 +172,9 @@
Pointer address
- Development Index + C Index

This is part of the Hive System Documentation. - Copyright (C) 2018 + Copyright (C) 2019 Hive Team. See the file Gnu Free Documentation License for copying conditions.

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 @@ Debugging - Development Index + C Index

Debugging

+

Check if the system have restrictions to attach to other processes or other hardening measures, check sysctl settings such as; kernel.yama.ptrace_scope;

+ +
+
kernel.yama.ptrace_scope=0
+
All processes can be debugged, they must have same uid.
+
kernel.yama.ptrace_scope=1
+
Only a parent process can be debugged.
+ +
kernel.yama.ptrace_scope=2
+
Require user privileges to use ptrace CAP_SYS_PTRACE capability.
+ +
kernel.yama.ptrace_scope=3
+
No processes may be traced with ptrace.
+ +
+ +

Before debug;

+ +
+        # echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
+        # sysctl -w kernel.yama.ptrace_scope=0
+
+        
+ +

After debug;

+ +
+        # echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope
+        # sysctl -w kernel.yama.ptrace_scope=1
+        
+ +

GDB

+

If the program needs arguments you can set it;

@@ -74,8 +107,14 @@
         break linespec thread threadno
         
+

Strace

+ +
+        $ strace -c ./program -o ~/program.strace
+        
+
-        strace -c ./program
+        $ strace -p 1337 -o ~/program.strace
         
@@ -87,11 +126,11 @@ Stopping and Starting multi-thread programs

- Development Index + C Index

This is part of the Hive System Documentation. - Copyright (C) 2018 + Copyright (C) 2019 Hive Team. See the file Gnu Free Documentation License for copying conditions.

diff --git a/dev/c/elements.html b/dev/c/elements.html index 9e31adb..49871db 100644 --- a/dev/c/elements.html +++ b/dev/c/elements.html @@ -5,7 +5,7 @@ Elements - Development Index + C Index

Elements

@@ -51,11 +51,11 @@

White space is ignored except when separating elements.

- Development Index + C Index

This is part of the Hive System Documentation. - Copyright (C) 2018 + Copyright (C) 2019 Hive Team. See the file Gnu Free Documentation License for copying conditions.

diff --git a/dev/c/hello.html b/dev/c/hello.html index ff31bc9..14c65e9 100644 --- a/dev/c/hello.html +++ b/dev/c/hello.html @@ -5,7 +5,7 @@ C & GDB - C & GDB Index + C Index

Hello World

@@ -123,7 +123,7 @@ (gdb) n - C & GDB Index + C Index

This is part of the Hive System Documentation. Copyright (C) 2019 diff --git a/dev/c/index.html b/dev/c/index.html index 3c48776..0e54a13 100644 --- a/dev/c/index.html +++ b/dev/c/index.html @@ -70,8 +70,8 @@ -

  • Debugging
  • -
  • System Development
  • +
  • Debugging
  • +
  • System Development