1
0
mirror of https://github.com/systemd/systemd.git synced 2025-10-21 15:33:40 +03:00

systemd-analyze: added the verb unit-gdb to spawn and attach gdb

This commit is contained in:
ZIHCO
2025-07-09 12:56:32 +01:00
committed by Luca Boccassi
parent 6235121abf
commit ad6e02e7b4
11 changed files with 264 additions and 56 deletions

View File

@@ -63,7 +63,7 @@ _systemd_analyze() {
local -A OPTS=(
[STANDALONE]='-h --help --version --system --user --global --order --require --no-pager
--man=no --generators=yes -q --quiet'
[ARG]='-H --host -M --machine --fuzz --from-pattern --to-pattern --root'
[ARG]='-H --host -M --machine --fuzz --from-pattern --to-pattern --root --debugger'
)
local -A VERBS=(
@@ -83,6 +83,7 @@ _systemd_analyze() {
[CAPABILITY]='capability'
[TRANSIENT_SETTINGS]='transient-settings'
[UNIT_SHELL]='unit-shell'
[UNIT_GDB]='unit-gdb'
)
local CONFIGS='locale.conf systemd/bootchart.conf systemd/coredump.conf systemd/journald.conf
@@ -241,6 +242,13 @@ _systemd_analyze() {
else
comps=$( __get_services $mode )
fi
elif __contains_word "$verb" ${VERBS[UNIT_GDB]}; then
if [[ $cur = -* ]]; then
comps='--help --version --debugger --debugger-arguments --root'
else
comps=$( __get_services $mode )
fi
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )