diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-08-16 01:24:05 -0400 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2020-08-16 15:26:26 -0400 |
| commit | 720a4adc91c632e097d9e064ce8e95617cf76fb0 (patch) | |
| tree | aa8ae98bff4aa53f99997f96a2f560be95f62d75 /gnu | |
| parent | 8b074a0abef78341d98ac4ca8e6f27bfcc7aa65b (diff) | |
system: Modify GDB skeleton to find debug files for any profile.
Instead of hard coding the debug directory to that of the user profile, use
Guile scripting in combination with a new search path specification on GDB to
specify the debug file directories.
* gnu/packages/gdb.scm (gdb-9.1): Add a search path specification for the
GDB_DEBUG_FILE_DIRECTORY environment variable.
* gnu/system/shadow.scm (default-skeletons)[gdbinit]: Derive the value of
DEBUG-FILE-DIRECTORY via the GDB_DEBUG_FILE_DIRECTORY environment variable.
* doc/guix.texi (Installing Debugging Files): Document it.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/gdb.scm | 7 | ||||
| -rw-r--r-- | gnu/system/shadow.scm | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm index 830121751fe..11e0bb3e763 100644 --- a/gnu/packages/gdb.scm +++ b/gnu/packages/gdb.scm | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com> | 5 | ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com> |
| 6 | ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> | 6 | ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> |
| 7 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 7 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
| 8 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> | ||
| 8 | ;;; | 9 | ;;; |
| 9 | ;;; This file is part of GNU Guix. | 10 | ;;; This file is part of GNU Guix. |
| 10 | ;;; | 11 | ;;; |
| @@ -117,6 +118,12 @@ | |||
| 117 | ("dejagnu" ,dejagnu) | 118 | ("dejagnu" ,dejagnu) |
| 118 | ("pkg-config" ,pkg-config) | 119 | ("pkg-config" ,pkg-config) |
| 119 | ,@(if (hurd-target?) `(("mig" ,mig)) '()))) | 120 | ,@(if (hurd-target?) `(("mig" ,mig)) '()))) |
| 121 | ;; TODO: Add support for the GDB_DEBUG_FILE_DIRECTORY environment variable | ||
| 122 | ;; in GDB itself instead of relying on some glue code in the Guix-provided | ||
| 123 | ;; .gdbinit file. | ||
| 124 | (native-search-paths (list (search-path-specification | ||
| 125 | (variable "GDB_DEBUG_FILE_DIRECTORY") | ||
| 126 | (files '("lib/debug"))))) | ||
| 120 | (home-page "https://www.gnu.org/software/gdb/") | 127 | (home-page "https://www.gnu.org/software/gdb/") |
| 121 | (synopsis "The GNU debugger") | 128 | (synopsis "The GNU debugger") |
| 122 | (description | 129 | (description |
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index a69339bc074..8c76bc2b113 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> | 3 | ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> |
| 4 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> | 4 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
| 5 | ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> | 5 | ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> |
| 6 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> | ||
| 6 | ;;; | 7 | ;;; |
| 7 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| 8 | ;;; | 9 | ;;; |
| @@ -162,7 +163,12 @@ XTerm*utf8: always | |||
| 162 | XTerm*metaSendsEscape: true\n")) | 163 | XTerm*metaSendsEscape: true\n")) |
| 163 | (gdbinit (plain-file "gdbinit" "\ | 164 | (gdbinit (plain-file "gdbinit" "\ |
| 164 | # Tell GDB where to look for separate debugging files. | 165 | # Tell GDB where to look for separate debugging files. |
| 165 | set debug-file-directory ~/.guix-profile/lib/debug | 166 | guile |
| 167 | (use-modules (gdb)) | ||
| 168 | (execute (string-append \"set debug-file-directory \" | ||
| 169 | (or (getenv \"GDB_DEBUG_FILE_DIRECTORY\") | ||
| 170 | \"~/.guix-profile/lib/debug\"))) | ||
| 171 | end | ||
| 166 | 172 | ||
| 167 | # Authorize extensions found in the store, such as the | 173 | # Authorize extensions found in the store, such as the |
| 168 | # pretty-printers of libstdc++. | 174 | # pretty-printers of libstdc++. |
