<commit_before># kernel

Redox OS Microkernel

[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![docs](https://img.shields.io/badge/docs-master-blue.svg)](https://doc.redox-os.org/kernel/kernel/)
[![](https://tokei.rs/b1/github/redox-os/kernel?category=code)](https://github.com/Aaronepower/tokei)


Documentation is still a work in progress
<commit_msg>Add documentation on using gdb<commit_after># kernel

Redox OS Microkernel

[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![docs](https://img.shields.io/badge/docs-master-blue.svg)](https://doc.redox-os.org/kernel/kernel/)
[![](https://tokei.rs/b1/github/redox-os/kernel?category=code)](https://github.com/Aaronepower/tokei)

## Debugging the redox kernel

Running [qemu] with the `-s` flag will set up [qemu] to listen on port 1234 for
a [gdb] client to connect to it. To debug the redox kernel run.

```
make qemu debug=yes
```

This will start a VM with and listen on port 1234 for a [gdb] client. Run the following
to connect to it.

```
(gdb) target remote localhost:1234
```

This is great, but without debug info debugging can be quite difficult. The
redox build process strips the kernel of debug info and copies the debug info
to a separate file `kernel.sym`. You can import these symbols in [gdb] with
the following

```
(gdb) symbol-file build/kernel.sym
```

Now you can set some interesting breakpoints and `continue` the process.

[qemu]: https://www.qemu.org
[gdb]: https://www.gnu.org/software/gdb/
{'fraction_non_alphanumeric': 0.15104166666666666, 'fraction_numerical': 0.009114583333333334, 'mean_word_length': 4.528776978417266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2030449', 'n_tokens_mistral': 548, 'n_tokens_neox': 511, 'n_words': 151}