<commit_before># Debugging Themenabend
Folien/Code vom Debugging-Themenabend am 25. September 2015 im [GCHQ](https://c3d2.de/news/ta-debugging.html)

Abhängigkeiten installieren:

debian/ubuntu:

```
$ apt-get install build-essential strace tcpdump sysdig gdb sysdig-dkms
```

archlinux:

```
$ pacman -S base-devel strace tcpdump sysdig gdb
$ systemctl restart dkms
```

Beispiele bauen mit:

```
$ make
```

## Strace/Syscalls

Infos zu Systemaufrufen:

- ```<syscall>(<arg1>, <arg2>, <arg2>) = <returncode>```

```bash
$ strace ./hello
execve("./hello", ["./hello"], [/* 107 vars */]) = 0
write(1, "Hello World\n", 12Hello World)         = 12
_exit(0)                                         = ?
+++ exited with 0 +++
$ man 2 execve<commit_msg>note for freebsd<commit_after># Debugging Themenabend
Folien/Code vom Debugging-Themenabend am 25. September 2015 im [GCHQ](https://c3d2.de/news/ta-debugging.html)

Abhängigkeiten installieren:

debian/ubuntu:

```
$ apt-get install build-essential strace tcpdump sysdig gdb sysdig-dkms
```

archlinux:

```
$ pacman -S base-devel strace tcpdump sysdig gdb
$ systemctl restart dkms
```

freebsd:
Gdb und tcpdump sind vorinstalliert, truss statt strace

Beispiele bauen mit:

```
$ make
```

## Strace/Syscalls

Infos zu Systemaufrufen:

- ```<syscall>(<arg1>, <arg2>, <arg2>) = <returncode>```

```bash
$ strace ./hello
execve("./hello", ["./hello"], [/* 107 vars */]) = 0
write(1, "Hello World\n", 12Hello World)         = 12
_exit(0)                                         = ?
+++ exited with 0 +++
$ man 2 execve
{'fraction_non_alphanumeric': 0.15866922584772872, 'fraction_numerical': 0.02943058221369162, 'mean_word_length': 3.3085399449035813, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2416459', 'n_tokens_mistral': 631, 'n_tokens_neox': 565, 'n_words': 144}