Skip to content

GDB plugin for powerlevel10k style prompt and WakaTime time tracking

License

Notifications You must be signed in to change notification settings

Freed-Wu/gdb-prompt

Repository files navigation

gdb-prompt

pre-commit.ci status github/workflow

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

This project provides:

screenshot

  • A WakaTime plugin to statistic how much time you debug code in gdb/cgdb.

Install

paru -S gdb-prompt-git
nix-env -iA nixos.nur.repos.Freed-Wu.gdb-prompt

Usage

Add the following code to ~/.config/gdb/gdbinit:

Prompt

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.

Wakatime

  1. Your gdb must be compiled with python port
  2. 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.

Customize

set_ps1 [prompt_string] [[text:fg_color_value:bg_color_value] [separator]] ...

customization

Alternatives

If you hate gdb script and want a more common language, you can try python.