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>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages gdb)
21 #:use-module (gnu packages)
22 #:use-module (gnu packages ncurses)
23 #:use-module (gnu packages readline)
24 #:use-module (gnu packages dejagnu)
25 #:use-module (gnu packages texinfo)
26 #:use-module (gnu packages multiprecision)
27 #:use-module (gnu packages xml)
28 #:use-module (gnu packages guile)
29 #:use-module (gnu packages python)
30 #:use-module (gnu packages pkg-config)
31 #:use-module ((guix licenses) #:select (gpl3+))
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system gnu))
42 (uri (string-append "mirror://gnu/gdb/gdb-"
46 "1a08c9svaihqmz2mm44il1gwa810gmwkckns8b0y0v3qz52amgby"))))
47 (build-system gnu-build-system)
49 `(#:tests? #f ; FIXME "make check" fails on single-processor systems.
51 #:modules ((srfi srfi-1)
52 ,@%gnu-build-system-modules)
54 #:phases (modify-phases %standard-phases
56 'configure 'post-configure
58 (for-each patch-makefile-SHELL
59 (find-files "." "Makefile\\.in"))))
61 'install 'remove-libs-already-in-binutils
62 (lambda* (#:key inputs outputs #:allow-other-keys)
63 ;; Like Binutils, GDB installs libbfd, libopcodes, etc.
64 ;; However, this leads to collisions when both are
65 ;; installed, and really is none of its business,
66 ;; conceptually. So remove them.
67 (let* ((binutils (assoc-ref inputs "binutils"))
68 (out (assoc-ref outputs "out"))
69 (files1 (with-directory-excursion binutils
70 (append (find-files "lib")
71 (find-files "include"))))
72 (files2 (with-directory-excursion out
73 (append (find-files "lib")
74 (find-files "include"))))
75 (common (lset-intersection string=?
77 (with-directory-excursion out
78 (for-each delete-file common)
84 ("readline" ,readline)
88 ("python-wrapper" ,python-wrapper)
91 ;; Allow use of XML-formatted syscall information. This enables 'catch
92 ;; syscall' and similar commands.
93 ("libxml2" ,libxml2)))
95 `(("texinfo" ,texinfo)
96 ("pkg-config" ,pkg-config)))
97 (home-page "http://www.gnu.org/software/gdb/")
98 (synopsis "The GNU debugger")
100 "GDB is the GNU debugger. With it, you can monitor what a program is
101 doing while it runs or what it was doing just before a crash. It allows you
102 to specify the runtime conditions, to define breakpoints, and to change how
103 the program is running to try to fix bugs. It can be used to debug programs
104 written in C, C++, Ada, Objective-C, Pascal and more.")