1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014, 2015, 2016, 2017, 2019-2022 Eric Bavier <bavier@posteo.net>
3 ;;; Copyright © 2016, 2017, 2018, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
6 ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com>
7 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
8 ;;; Copyright © 2020, 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
9 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
10 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
11 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages debug)
29 #:use-module (guix packages)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix utils)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system cmake)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages attr)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bash)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages c)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages code)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages flex)
47 #:use-module (gnu packages gdb)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gtk)
50 #:use-module (gnu packages golang)
51 #:use-module (gnu packages image)
52 #:use-module (gnu packages libusb)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages llvm)
55 #:use-module (gnu packages ncurses)
56 #:use-module (gnu packages ninja)
57 #:use-module (gnu packages perl)
58 #:use-module (gnu packages pkg-config)
59 #:use-module (gnu packages pretty-print)
60 #:use-module (gnu packages python)
61 #:use-module (gnu packages python-check)
62 #:use-module (gnu packages python-xyz)
63 #:use-module (gnu packages readline)
64 #:use-module (gnu packages serialization)
65 #:use-module (gnu packages texinfo)
66 #:use-module (gnu packages virtualization)
67 #:use-module (gnu packages xdisorg)
68 #:use-module (ice-9 match)
69 #:use-module (srfi srfi-1))
74 (version "2006.08.03")
79 (string-append "mirror://debian/pool/main/d/delta/"
80 "delta_" version ".orig.tar.gz")
81 ;; This uri seems to send guix download into an infinite loop
82 (string-append "http://delta.tigris.org/files/documents/3103/"
83 "33566/delta-" version ".tar.gz")))
86 "184wh35pf2ddx97319s6sgkzpz48xxkbwzcjpycv009bm53lh61q"))))
87 (build-system gnu-build-system)
88 (inputs ;Installed programs are perl scripts
92 (modify-phases %standard-phases
94 (lambda* (#:key outputs #:allow-other-keys)
95 ;; Makefile contains no install target
96 (let* ((out (assoc-ref outputs "out"))
97 (bin (string-append out "/bin"))
98 (doc (string-append out "/share/doc/delta-" ,version)))
100 (for-each (lambda (h)
101 (install-file h doc))
102 `("License.txt" ,@(find-files "www" ".*\\.html")))
103 (for-each (lambda (b)
104 (install-file b bin))
105 `("delta" "multidelta" "topformflat"))))
107 (delete 'configure)))) ; no configure script
108 (home-page "http://delta.tigris.org/")
109 (synopsis "Heuristical file minimizer")
111 "Delta assists you in minimizing \"interesting\" files subject to a test
112 of their interestingness. A common such situation is when attempting to
113 isolate a small failure-inducing substring of a large input that causes your
114 program to exhibit a bug.")
115 ;; See License.txt, which is a bsd-3 license, despite the project's
116 ;; home-page pointing to a bsd-2 license.
117 (license license:bsd-3)))
119 (define-public c-reduce
127 (string-append "http://embed.cs.utah.edu/creduce/"
128 "creduce-" version ".tar.gz")))
130 (base32 "0qx0zq8jxzx2as2zf0740g7kvgq163ayn3041di4vwk77490y76v"))))
131 (build-system gnu-build-system)
132 (native-inputs (list flex))
139 ("exporter-lite" ,perl-exporter-lite)
140 ("file-which" ,perl-file-which)
141 ("getopt-tabular" ,perl-getopt-tabular)
142 ("regex-common" ,perl-regexp-common)
143 ("term-readkey" ,perl-term-readkey)))
146 (modify-phases %standard-phases
149 (with-directory-excursion "tests"
150 ;; Running all tests can take a looong time, and tests 4 and 5
151 ;; require frama-c or kcc. So run just one for sanity.
152 (invoke "./run_tests" "1"))))
153 (add-after 'install 'set-load-paths
154 (lambda* (#:key inputs outputs #:allow-other-keys)
155 ;; Tell creduce where to find the perl modules it needs.
156 (let* ((out (assoc-ref outputs "out"))
157 (prog (string-append out "/bin/creduce")))
160 `("PERL5LIB" ":" prefix
162 (string-append (assoc-ref inputs p)
163 "/lib/perl5/site_perl/"
164 ,(package-version perl)))
165 '("term-readkey" "exporter-lite"
166 "file-which" "getopt-tabular"
169 (home-page "https://embed.cs.utah.edu/creduce")
170 (synopsis "Reducer for interesting code")
172 "C-Reduce is a tool that takes a large C or C++ program that has a
173 property of interest (such as triggering a compiler bug) and automatically
174 produces a much smaller C/C++ program that has the same property. It is
175 intended for use by people who discover and report bugs in compilers and other
176 tools that process C/C++ code.")
177 (license license:ncsa)))
179 (define-public c-vise
187 (url "https://github.com/marxin/cvise")
188 (commit (string-append "v" version))))
190 (base32 "1i2z5q2pcwh1gpdqc24x1a2q5vzwhblzzq021nzwf304di7m18vl"))
191 (file-name (git-file-name name version))))
192 (build-system cmake-build-system)
194 (list flex python-pytest python-pytest-flake8))
196 (list bash-minimal clang llvm unifdef
197 python python-pebble python-psutil python-chardet))
200 (modify-phases %standard-phases
201 (add-before 'build 'hardcode-paths
203 (substitute* "cvise.py"
204 (("/bin/bash") (which "bash"))
205 (("(.*)# Special case for clang-format" & >)
206 (string-append > "# Special case for unifdef\n"
207 > "programs['unifdef'] = '" (which "unifdef") "'\n"
209 (add-after 'install 'wrap
210 (lambda* (#:key outputs #:allow-other-keys)
211 (let ((out (assoc-ref outputs "out"))
212 (python-path (getenv "GUIX_PYTHONPATH")))
213 (wrap-program (string-append out "/bin/cvise")
214 `("PYTHONPATH" ":" prefix (,python-path)))
216 (home-page "https://github.com/marxin/cvise")
217 (synopsis "Reducer for interesting code")
219 "C-Vise is a Python port of the C-Reduce tool that is fully compatible
220 and uses the same efficient LLVM-based C/C++ @code{clang_delta} reduction
222 (license license:ncsa)))
224 (define-public american-fuzzy-lop
225 (let ((machine (match (or (%current-target-system)
227 ("x86_64-linux" "x86_64")
228 ("i686-linux" "i386")
229 ("aarch64-linux" "aarch64")
230 ("armhf-linux" "arm")
231 ("mips64el-linux" "mips64el")
232 ("powerpc-linux" "ppc")
233 ;; Prevent errors when querying this package on unsupported
234 ;; platforms, e.g. when running "guix package --search="
237 (name "american-fuzzy-lop")
238 (version "2.57b") ;It seems all releases have the 'b' suffix
243 (url "https://github.com/google/AFL")
244 (commit (string-append "v" version))))
246 (base32 "0ks0s8iizp7mpc9mlpv126rsny0dkljfsw68689g9jiisjz2z530"))
247 (file-name (git-file-name name version))))
248 (build-system gnu-build-system)
250 (list qemu-for-american-fuzzy-lop))
252 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
253 (string-append "DOC_PATH=$(PREFIX)/share/doc/"
256 #:phases (modify-phases %standard-phases
257 (add-after 'unpack 'make-git-checkout-writable
259 (for-each make-file-writable (find-files "."))
262 ,@(if (string=? (%current-system) (or "x86_64-linux"
265 '((add-before 'build 'set-afl-flag
266 (lambda _ (setenv "AFL_NO_X86" "1") #t))
267 (add-after 'install 'remove-x86-programs
268 (lambda* (#:key outputs #:allow-other-keys)
269 (let* ((out (assoc-ref outputs "out"))
270 (bin (string-append out "/bin/")))
271 (delete-file (string-append bin "afl-gcc"))
272 (delete-file (string-append bin "afl-g++"))
273 (delete-file (string-append bin "afl-clang"))
274 (delete-file (string-append bin "afl-clang++")))
277 ;; TODO: Build and install the afl-llvm tool.
278 'install 'install-qemu
279 (lambda* (#:key inputs outputs #:allow-other-keys)
280 (let ((qemu (assoc-ref inputs "qemu"))
281 (out (assoc-ref outputs "out")))
282 (symlink (string-append qemu "/bin/qemu-" ,machine)
283 (string-append out "/bin/afl-qemu-trace"))
285 (delete 'check)))) ; tests are run during 'install phase
286 (home-page "https://lcamtuf.coredump.cx/afl/")
287 (synopsis "Security-oriented fuzzer")
289 "American fuzzy lop is a security-oriented fuzzer that employs a novel
290 type of compile-time instrumentation and genetic algorithms to automatically
291 discover clean, interesting test cases that trigger new internal states in the
292 targeted binary. This substantially improves the functional coverage for the
293 fuzzed code. The compact synthesized corpora produced by the tool are also
294 useful for seeding other, more labor- or resource-intensive testing regimes
296 (license license:asl2.0))))
298 (define-public qemu-for-american-fuzzy-lop
299 ;; afl only supports using a single afl-qemu-trace executable, so
300 ;; we only build qemu for the native target.
301 (let ((machine (match (or (%current-target-system)
303 ("x86_64-linux" "x86_64")
304 ("i686-linux" "i386")
305 ("aarch64-linux" "aarch64")
306 ("armhf-linux" "arm")
307 ("mips64el-linux" "mips64el")
308 ("powerpc-linux" "ppc")
309 ;; Prevent errors when querying this package on unsupported
310 ;; platforms, e.g. when running "guix package --search="
318 (uri (string-append "https://download.qemu.org/qemu-"
322 "17w21spvaxaidi2am5lpsln8yjpyp2zi3s3gc6nsxj5arlgamzgw"))
324 (search-patches "qemu-glibc-2.27.patch"
325 "qemu-glibc-2.30.patch"))))
326 (build-system gnu-build-system)
328 `(;; Running tests in parallel can occasionally lead to failures, like:
329 ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
332 (list (string-append "--target-list=" ,machine "-linux-user"))
333 #:make-flags '("V=1")
335 (modify-phases %standard-phases
337 (lambda* (#:key inputs outputs (configure-flags '())
339 ;; The `configure' script doesn't understand some of the
340 ;; GNU options. Thus, add a new phase that's compatible.
341 (let ((out (assoc-ref outputs "out")))
342 (setenv "SHELL" (which "bash"))
344 ;; While we're at it, patch for tests.
345 (substitute* "tests/libqtest.c"
346 (("/bin/sh") (which "sh")))
348 ;; The binaries need to be linked against -lrt.
349 (setenv "LDFLAGS" "-lrt")
352 ,(string-append "--cc=" (which "gcc"))
353 ;; Some architectures insist on using HOST_CC
354 ,(string-append "--host-cc=" (which "gcc"))
355 "--disable-debug-info" ; save build space
356 "--enable-virtfs" ; just to be sure
357 ,(string-append "--prefix=" out)
358 ,(string-append "--sysconfdir=/etc")
359 ,@configure-flags)))))
361 'unpack 'apply-afl-patches
362 (lambda* (#:key inputs #:allow-other-keys)
363 (let* ((afl-src (assoc-ref inputs "afl-source"))
364 (patch-dir "qemu_mode/patches"))
365 (copy-recursively (string-append afl-src "/"
369 (string-append patch-dir
370 "/afl-qemu-cpu-inl.h")
372 (copy-file (string-append afl-src "/config.h")
374 (install-file (string-append afl-src "/types.h")
376 (substitute* "afl-qemu-cpu-inl.h"
377 (("\\.\\./\\.\\./config.h") "afl-config.h"))
378 (substitute* (string-append patch-dir
380 (("\\.\\./patches/") ""))
382 ;; These were already applied to qemu-minimal-2.10.
383 (for-each (lambda (obsolete-patch)
384 (delete-file (string-append
387 (list "configure.diff"
390 (for-each (lambda (patch-file)
391 (invoke "patch" "--force" "-p1"
392 "--input" patch-file))
393 (find-files patch-dir
396 (add-before 'check 'disable-unusable-tests
397 (lambda* (#:key inputs outputs #:allow-other-keys)
398 (substitute* "tests/Makefile.include"
399 ;; Comment out the test-qga test, which needs /sys and
400 ;; fails within the build environment.
401 (("check-unit-.* tests/test-qga" all)
402 (string-append "# " all)))
403 (substitute* "tests/Makefile.include"
404 ;; Comment out the test-char test, which needs networking and
405 ;; fails within the build environment.
406 (("check-unit-.* tests/test-char" all)
407 (string-append "# " all)))
410 `(("python-2" ,python-2) ; QEMU 2 needs Python 2
411 ("glib:bin" ,glib "bin")
415 ("pkg-config" ,pkg-config)))
417 `(("afl-source" ,(package-source american-fuzzy-lop))
418 ("alsa-lib" ,alsa-lib)
424 ("libjpeg" ,libjpeg-turbo)
428 ("util-linux" ,util-linux)
430 (home-page "https://www.qemu.org")
431 (synopsis "Machine emulator and virtualizer (without GUI) for american fuzzy lop")
433 "QEMU is a generic machine emulator and virtualizer. This package
434 of QEMU is used only by the american fuzzy lop package.
436 When used as a machine emulator, QEMU can run OSes and programs made for one
437 machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
438 using dynamic translation, it achieves very good performance.
440 When used as a virtualizer, QEMU achieves near native performances by
441 executing the guest code directly on the host CPU. QEMU supports
442 virtualization when executing under the Xen hypervisor or using
443 the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
444 server and embedded PowerPC, and S390 guests.")
445 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
446 (license license:gpl2)
447 ;; Several tests fail on MIPS.
448 (supported-systems (delete "mips64el-linux" %supported-systems))))))
450 (define-public stress-make
451 (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
452 (revision "2")) ;No official source distribution
455 (version (git-version "1.0" revision commit))
460 (url "https://github.com/lanl/stress-make")
462 (file-name (git-file-name name version))
465 "0k55cy7x0hlc6rgpascl6ibhcfxaash3p9r9r8kwvbm3zag1rmac"))))
466 (build-system gnu-build-system)
468 (list autoconf automake go))
470 `(("make-source" ,(package-source gnu-make))))
472 ;; stress-make's configure script insists on having a tarball and does
473 ;; not accept a directory name instead. To let the gnu-build-system's
474 ;; patch-* phases work properly, we unpack the source first, then
475 ;; repack before the configure phase.
476 (let ((make-dir (string-append "make-" (package-version gnu-make))))
477 `(#:configure-flags '("--with-make-tar=./make.tar.xz"
478 "make_cv_sys_gnu_glob=yes")
480 (modify-phases %standard-phases
481 (add-after 'unpack 'unpack-make
482 (lambda* (#:key inputs #:allow-other-keys)
483 (invoke "tar" "xf" (assoc-ref inputs "make-source"))))
484 (add-after 'unpack-make 'set-default-shell
486 ;; Taken mostly directly from (@ (gnu packages base) gnu-make)
487 (substitute* (string-append ,make-dir "/src/job.c")
488 (("default_shell = .*$")
489 (format #f "default_shell = \"~a\";\n"
491 (add-before 'configure 'repack-make
493 (invoke "tar" "cJf" "./make.tar.xz" ,make-dir)))
494 (add-before 'build 'setup-go
495 ;; The Go cache is required starting in Go 1.12, and it needs
497 (lambda _ (setenv "GOCACHE" "/tmp/go-cache") #t))))))
498 (home-page "https://github.com/lanl/stress-make")
499 (synopsis "Expose race conditions in Makefiles")
501 "Stress Make is a customized GNU Make that explicitly manages the order
502 in which concurrent jobs are run to provoke erroneous behavior into becoming
503 manifest. It can run jobs in the order in which they're launched, in backwards
504 order, or in random order. The thought is that if code builds correctly with
505 Stress Make, then it is likely that the @code{Makefile} contains no race
507 ;; stress-make wrapper is under BSD-3-modifications-must-be-indicated,
508 ;; and patched GNU Make is under its own license.
509 (license (list (license:non-copyleft "LICENSE.md")
520 "https://github.com/samhocevar/zzuf/releases/download/v"
521 version "/" name "-" version ".tar.gz"))
522 (file-name (string-append name "-" version ".tar.gz"))
525 "1mpzjaksc2qg2hzqflf39pl06p53qam2dn3hkhkcv6p00d2n4kx3"))))
526 (build-system gnu-build-system)
527 (home-page "https://github.com/samhocevar/zzuf")
528 (synopsis "Transparent application input fuzzer")
529 (description "Zzuf is a transparent application input fuzzer. It works by
530 intercepting file operations and changing random bits in the program's
531 input. Zzuf's behaviour is deterministic, making it easy to reproduce bugs.")
532 (license license:wtfpl2)))
534 (define-public scanmem
542 (url "https://github.com/scanmem/scanmem")
543 (commit (string-append "v" version))))
544 (file-name (git-file-name name version))
547 "17p8sh0rj8yqz36ria5bp48c8523zzw3y9g8sbm2jwq7sc27i7s9"))))
548 (build-system gnu-build-system)
550 `(#:configure-flags '("--enable-gui")
552 (modify-phases %standard-phases
553 (add-before 'configure 'hardcode-python
554 (lambda* (#:key inputs outputs #:allow-other-keys)
555 (substitute* "gui/GameConqueror.py"
556 (("/usr/bin/env python")
557 (search-input-file inputs "/bin/python")))))
558 (add-after 'install 'wrap-gameconqueror
559 (lambda* (#:key inputs outputs #:allow-other-keys)
560 (let ((out (assoc-ref outputs "out"))
561 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
562 (python-path (getenv "GUIX_PYTHONPATH")))
563 (wrap-program (string-append out "/share/gameconqueror/GameConqueror.py")
564 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
565 `("GUIX_PYTHONPATH" ":" prefix (,python-path))))
570 gobject-introspection
578 (list python-pygobject))
579 (home-page "https://github.com/scanmem/scanmem")
580 (synopsis "Memory scanner")
581 (description "Scanmem is a debugging utility designed to isolate the
582 address of an arbitrary variable in an executing process. Scanmem simply
583 needs to be told the pid of the process and the value of the variable at
584 several different times. After several scans of the process, scanmem isolates
585 the position of the variable and allows you to modify its value.")
586 ;; The library is covered by LGPLv3 or later; the application is covered
587 ;; by GPLv3 or later.
588 (license (list license:lgpl3+ license:gpl3+))))
590 (define-public remake
591 (package (inherit gnu-make)
596 (uri (let ((upstream-version
597 (match (string-split version #\-)
598 ((ver sub) (string-append ver "%2Bdbg-" sub)))))
599 (string-append "mirror://sourceforge/bashdb/"
600 "remake/" upstream-version "/"
601 "remake-" upstream-version ".tar.gz")))
602 (file-name (string-append "remake-" version ".tar.gz"))
605 "0xlx2485y0israv2pfghmv74lxcv9i5y65agy69mif76yc4vfvif"))
606 (patches (search-patches "remake-impure-dirs.patch"))))
608 (modify-inputs (package-inputs gnu-make)
610 (home-page "http://bashdb.sourceforge.net/remake/")
611 (description "Remake is an enhanced version of GNU Make that adds improved
612 error reporting, better tracing, profiling, and a debugger.")
613 (license license:gpl3+)))
622 (url "https://github.com/mozilla/rr")
626 "1sfldgkkmsdyaqa28i5agcykc63gwm3zjihd64g86i852w8al2w6"))
627 (file-name (git-file-name name version))))
628 (build-system cmake-build-system)
631 ;; The 'rr_exec_stub' is a static binary, which leads CMake to fail
632 ;; with ‘file RPATH_CHANGE could not write new RPATH: ...’.
633 ;; Clear CMAKE_INSTALL_RPATH to avoid that problem.
634 (list "-DCMAKE_INSTALL_RPATH="
635 ;; Satisfy the ‘validate-runpath’ phase. This isn't a direct
636 ;; consequence of clearing CMAKE_INSTALL_RPATH.
637 (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
638 (assoc-ref %build-inputs "capnproto") "/lib")
639 ,@(if (and (not (%current-target-system))
640 (member (%current-system)
641 '("x86_64-linux" "aarch64-linux")))
642 ;; The toolchain doesn't support '-m32'.
643 '("-Ddisable32bit=ON")
646 ;; XXX: Most tests fail with:
648 ;; rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
650 ;; This setting cannot be changed from the build environment, so skip
654 #:phases (modify-phases %standard-phases
655 (add-before 'check 'set-home
657 ;; Some tests expect 'HOME' to be set.
658 (setenv "HOME" (getcwd))
661 (list pkg-config ninja which))
663 (list gdb capnproto python python-pexpect))
664 (home-page "https://rr-project.org/")
665 (synopsis "Record and reply debugging framework")
667 "rr is a lightweight tool for recording, replaying and debugging
668 execution of applications (trees of processes and threads). Debugging extends
669 GDB with very efficient reverse-execution, which in combination with standard
670 GDB/x86 features like hardware data watchpoints, makes debugging much more
672 (license license:expat)))
674 (define-public libbacktrace
675 ;; There are no releases nor tags.
677 (commit "5009c113981431ae1843ebd29d6ad24eb32fc1b2"))
679 (name "libbacktrace")
680 (version (git-version "1.0" revision commit))
684 (url "https://github.com/ianlancetaylor/libbacktrace")
686 (file-name (git-file-name name version))
689 "0663zjpfpnsyv9h3pbp7cgmg9gz79n68bqpdl97y6i0jsx93v1zg"))))
690 (build-system gnu-build-system)
692 `(#:make-flags '("CFLAGS=-fPIC")))
693 (home-page "https://github.com/ianlancetaylor/libbacktrace")
694 (synopsis "C library for producing symbolic backtraces")
695 (description "The @code{libbacktrace} library can be linked into a C/C++
696 program to produce symbolic backtraces.")
697 (license license:bsd-3))))
699 (define-public libleak
706 (url "https://github.com/WuBingzheng/libleak")
707 (commit (string-append "v" version))))
708 (file-name (git-file-name name version))
711 "1p8mb0hcfp8hdv1klv6rrpkn2zlhjxgkxbbjsk8kszxv7ijln87d"))))
712 (build-system gnu-build-system)
714 `(#:tests? #f ;no test suite
715 #:parallel-build? #f ;jobserver unavailable
716 #:phases (modify-phases %standard-phases
717 (add-after 'unpack 'unbundle-libwuya
719 (substitute* "Makefile"
720 ((".*make -C libwuya.*") ""))
722 (add-before 'build 'set-CC
726 (delete 'configure) ;no configure script
728 (lambda* (#:key outputs #:allow-other-keys)
729 (let* ((out (assoc-ref outputs "out")))
730 (install-file "libleak.so" (string-append out "/lib"))
732 (inputs (list libbacktrace libwuya))
733 (home-page "https://github.com/WuBingzheng/libleak")
734 (synopsis "Memory leaks detection tool")
735 (description "The libleak tool detects memory leaks by hooking memory
736 functions such as @code{malloc}. It comes as a shared object to be pre-loaded
737 via @code{LD_PRELOAD} when launching the application. It prints the full call
738 stack at suspicious memory leak points. Modifying or recompiling the target
739 program is not required, and the detection can be enabled or disabled while
740 the target application is running. The overhead incurred by libleak is
741 smaller than that of other tools such as Valgrind, and it aims to be easier to
742 use than similar tools like @command{mtrace}.")
743 (license license:gpl2+)))
752 (uri (string-append "https://cgdb.me/files/cgdb-" version ".tar.gz"))
754 (base32 "1671gpz5gx5j0zga8xy2x7h33vqh3nij93lbb6dbb366ivjknwmv"))))
755 (build-system gnu-build-system)
757 (list ncurses readline))
760 (home-page "https://cgdb.github.io")
761 (synopsis "Console front-end to the GNU debugger")
763 "@code{cgdb} is a lightweight curses (terminal-based) interface to the
764 GNU Debugger (GDB). In addition to the standard gdb console, cgdb provides
765 a split screen view that displays the source code as it executes. The
766 keyboard interface is modeled after vim, so vim users should feel at home
768 (license license:gpl2+)))
770 (define-public mspdebug
771 ;; Last official release was 24 July 2017
772 (let ((commit "4c4d94e43bc4a18ecf82070ff81cd38dd5641e3b")
776 (version (git-version "0.25" revision commit))
780 (url "https://github.com/dlbeer/mspdebug")
782 (file-name (git-file-name name version))
784 (base32 "1lgw1dsc1aglyja610ichadvgs5b0df3wlarinczb0ykf431gjln"))))
785 (build-system gnu-build-system)
787 `(#:tests? #f ; no test suite
789 (modify-phases %standard-phases
790 (delete 'configure)) ; no configure script
792 (list (string-append "CC=" ,(cc-for-target))
794 (string-append "PREFIX=" %output))))
796 (list libusb-compat readline))
797 (synopsis "Debugging tool for MSP430 MCUs")
798 (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
799 MSP430-JTAG-TINY programmers, as well as many other compatible
800 devices. It can be used as a proxy for gdb or as an independent
801 debugger with support for programming, disassembly and reverse
803 (home-page "https://github.com/dlbeer/mspdebug")
804 (license license:gpl2+))))