1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages gdb)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages ncurses)
24 #:use-module (gnu packages readline)
25 #:use-module (gnu packages dejagnu)
26 #:use-module (gnu packages texinfo)
27 #:use-module (gnu packages multiprecision)
28 #:use-module (gnu packages xml)
29 #:use-module (gnu packages guile)
30 #:use-module (gnu packages python)
31 #:use-module (gnu packages pkg-config)
32 #:use-module ((guix licenses) #:select (gpl3+))
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix build-system gnu))
43 (uri (string-append "mirror://gnu/gdb/gdb-"
47 "0d2bpqk58fqlx21rbnk8mbcjlggzc9kb5sjirrfrrrjq70ka0qdg"))))
48 (build-system gnu-build-system)
50 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
52 #:modules ((srfi srfi-1)
53 ,@%gnu-build-system-modules)
55 #:phases (modify-phases %standard-phases
57 'configure 'post-configure
59 (for-each patch-makefile-SHELL
60 (find-files "." "Makefile\\.in"))))
62 'install 'remove-libs-already-in-binutils
63 (lambda* (#:key inputs outputs #:allow-other-keys)
64 ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
65 ;; However, this leads to collisions when both are
66 ;; installed, and really is none of its business,
67 ;; conceptually. So remove them.
68 (let* ((binutils (assoc-ref inputs "binutils"))
69 (out (assoc-ref outputs "out"))
70 (files1 (with-directory-excursion binutils
71 (append (find-files "lib")
72 (find-files "include"))))
73 (files2 (with-directory-excursion out
74 (append (find-files "lib")
75 (find-files "include"))))
76 (common (lset-intersection string=?
78 (with-directory-excursion out
79 (for-each delete-file common)
85 ("readline" ,readline)
89 ("python-wrapper" ,python-wrapper)
92 ;; Allow use of XML-formatted syscall information. This enables 'catch
93 ;; syscall' and similar commands.
94 ("libxml2" ,libxml2)))
96 `(("texinfo" ,texinfo)
97 ("pkg-config" ,pkg-config)))
98 (home-page "https://www.gnu.org/software/gdb/")
99 (synopsis "The GNU debugger")
101 "GDB is the GNU debugger. With it, you can monitor what a program is
102 doing while it runs or what it was doing just before a crash. It allows you
103 to specify the runtime conditions, to define breakpoints, and to change how
104 the program is running to try to fix bugs. It can be used to debug programs
105 written in C, C++, Ada, Objective-C, Pascal and more.")