This project provides:
- A GDB plugin for powerlevel10k-like prompt written in pure gdb script without dependency on the python port of gdb!
paru -S gdb-prompt-git
nix-env -iA nixos.nur.repos.Freed-Wu.gdb-prompt
Add the following code to ~/.config/gdb/gdbinit
:
source /the/path/of/this/directory/gdb-prompt
Or just gdb-prompt
(Yes, this file has a shebang) to open a gdb with
a powerlevel10k-like prompt.
- Your
gdb
must be compiled with python port - Depends on repl-python-wakatime
define hook-stop
source /the/path/of/this/directory/gdb-hook.py
end
It will send wakatime heartbeat every step
, next
, ...
If you want to only send wakatime heartbeat every step
, just
define hook-step
source /the/path/of/this/directory/gdb-hook.py
end
See GDB Hooks to know more.
Use environment variables HOOK_NAMES=hook1:hook2
to defines which hook will be
used. Available hooks can be seen
here.
set_ps1 [prompt_string] [[text:fg_color_value:bg_color_value] [separator]] ...
- See Color Handling of
man 5 terminfo
for color name/value. - See powerline-extra-symbols for separator.
- See gdb.prompt for prompt escape code.
- Escape
"\\"
to many times by the reverse order of 2, 4, 8, ... gdb script doesn't have string concatenate functions. We must useeval "set $str = \"%s%s\"", $str1, $str2
to do it, whicheval
will convert"\\\\"
to"\\"
.
If you hate gdb script and want a more common language, you can try python.