summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-02-19 10:41:31 +0100
committerLudovic Courtès <ludo@gnu.org>2026-02-27 23:54:00 +0100
commita1611ced6de6e58ec77641281a49ed368d7d8cef (patch)
tree36b942e2d7f0923c7136ed6f49cd0b984a2714d0
parent1892626390bac09f8942519c20cae4ace1758275 (diff)
system: gdbinit: Save command history by default.
By default, GDB does not save history. This improves on the default. * gnu/system/shadow.scm (%default-gdbinit): Add ‘set history’ commands. (gdb-history-placeholder): New variable. (default-skeletons): Add it. Change-Id: Ie3f9c26098066b4bd896b0593546015a1b429209 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #6559
-rw-r--r--gnu/system/shadow.scm17
1 files changed, 15 insertions, 2 deletions
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index aa7aec782fa..f0749972d2c 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013-2020, 2022-2023, 2025 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013-2020, 2022-2023, 2025-2026 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020, 2023 Efraim Flashner <efraim@flashner.co.il>
@@ -211,7 +211,13 @@ XTerm*metaSendsEscape: true\n"))
(define %default-gdbinit
(plain-file "gdbinit"
- "# Tell GDB where to look for separate debugging files.
+ "\
+# Record command history.
+set history filename ~/.cache/gdb/history
+set history save on
+set history size 50000
+
+# Tell GDB where to look for separate debugging files.
guile
(use-modules (gdb))
(execute (string-append \"set debug-file-directory \"
@@ -291,6 +297,12 @@ for a colorful Guile experience.\\n\\n\"))))\n"))
home-config"))
+(define gdb-history-placeholder
+ ;; Since GDB will not create ~/.cache/gdb by itself when attempting to save
+ ;; its history file, add a placeholder that ensures this directory exists.
+ (plain-file "gdb-history"
+ "# GDB command history.\n"))
+
(define (default-skeletons)
"Return the default skeleton files for /etc/skel. These files are copied by
'useradd' in the home directory of newly created user accounts."
@@ -308,6 +320,7 @@ home-config"))
(".Xdefaults" ,xdefaults)
(".guile" ,%default-dotguile)
(".config/gdb/gdbinit" ,gdbinit)
+ (".cache/gdb/history" ,gdb-history-placeholder)
("guix-home-config.scm" ,%default-skeleton-home-config))))
(define (skeleton-directory skeletons)