-
Notifications
You must be signed in to change notification settings - Fork 720
Hacking
Johannes Altmanninger edited this page Aug 7, 2022
·
4 revisions
If you want to use Clang tools (e.g. clangd via kak-lsp) to hack on Kakoune's C++ sources. you'll need to create a compile_commands.json
file so the Clang tool will use the correct build flags.
One solution is to wrap your make
invocations with bear:
bear -- make debug=yes clean all
Another solution is to teach the build system to output compile_commands.json
.
For debugging interactive scenarios that don't have tests yet you can usegdbserver
:
gdbserver :2345 ./kak; reset
(If Kakoune crashes, it might not be able to reset terminal modes. The reset
takes care of that.)
Then, connect to gdbserver
from another terminal
gdb -ex 'target remote :2345'
Since this is a remote target, gdbserver will by default fail to pick up pretty printers (for both stdlib and Kakoune types).
To fix this, add this to your ~/.gdbinit
(or to src/.gdbinit
):
set sysroot
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV