gnu: Add emacs-sbt-mode.
[jackhill/guix/guix.git] / gnu / packages / debug.scm
CommitLineData
8d809faf 1;;; GNU Guix --- Functional package management for GNU
4dfbebdb 2;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2020 Eric Bavier <bavier@posteo.net>
ff66791d 3;;; Copyright © 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
2b30af95 4;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
f20c64ed 5;;; Copyright © 2018, 2019 Rutger Helling <rhelling@mykolab.com>
a778f270 6;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com>
a5a2d79b 7;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
11f1001c 8;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
8d809faf
EB
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages debug)
26 #:use-module (guix packages)
c9164d30 27 #:use-module ((guix licenses) #:prefix license:)
8d809faf 28 #:use-module (guix download)
b718bef0 29 #:use-module (guix git-download)
426fde9a 30 #:use-module (guix utils)
8d809faf 31 #:use-module (guix build-system gnu)
8a49e63b 32 #:use-module (guix build-system cmake)
268efd97
LF
33 #:use-module (gnu packages)
34 #:use-module (gnu packages attr)
b718bef0
EB
35 #:use-module (gnu packages autotools)
36 #:use-module (gnu packages base)
426fde9a 37 #:use-module (gnu packages bash)
268efd97 38 #:use-module (gnu packages bison)
8a49e63b 39 #:use-module (gnu packages code)
268efd97 40 #:use-module (gnu packages compression)
426fde9a 41 #:use-module (gnu packages flex)
8a49e63b 42 #:use-module (gnu packages gdb)
a778f270 43 #:use-module (gnu packages glib)
f20c64ed 44 #:use-module (gnu packages gtk)
b718bef0 45 #:use-module (gnu packages golang)
268efd97 46 #:use-module (gnu packages image)
11f1001c 47 #:use-module (gnu packages libusb)
268efd97 48 #:use-module (gnu packages linux)
426fde9a 49 #:use-module (gnu packages llvm)
268efd97 50 #:use-module (gnu packages ncurses)
8a49e63b 51 #:use-module (gnu packages ninja)
426fde9a 52 #:use-module (gnu packages perl)
8a49e63b 53 #:use-module (gnu packages pkg-config)
9b459fc7 54 #:use-module (gnu packages pretty-print)
f20c64ed 55 #:use-module (gnu packages python)
8a49e63b 56 #:use-module (gnu packages python-xyz)
a778f270 57 #:use-module (gnu packages readline)
8a49e63b 58 #:use-module (gnu packages serialization)
59132b80 59 #:use-module (gnu packages virtualization)
268efd97 60 #:use-module (gnu packages xdisorg)
9b459fc7
EB
61 #:use-module (ice-9 match)
62 #:use-module (srfi srfi-1))
8d809faf
EB
63
64(define-public delta
65 (package
66 (name "delta")
67 (version "2006.08.03")
68 (source
69 (origin
70 (method url-fetch)
71 (uri (list
efd63d02 72 (string-append "mirror://debian/pool/main/d/delta/"
8d809faf
EB
73 "delta_" version ".orig.tar.gz")
74 ;; This uri seems to send guix download into an infinite loop
75 (string-append "http://delta.tigris.org/files/documents/3103/"
76 "33566/delta-" version ".tar.gz")))
77 (sha256
78 (base32
79 "184wh35pf2ddx97319s6sgkzpz48xxkbwzcjpycv009bm53lh61q"))))
80 (build-system gnu-build-system)
81 (inputs ;Installed programs are perl scripts
82 `(("perl" ,perl)))
83 (arguments
84 `(#:phases
dc1d3cde
KK
85 (modify-phases %standard-phases
86 (replace 'install
87 (lambda* (#:key outputs #:allow-other-keys)
88 ;; Makefile contains no install target
89 (let* ((out (assoc-ref outputs "out"))
90 (bin (string-append out "/bin"))
91 (doc (string-append out "/share/doc/delta-" ,version)))
92 (begin
dc1d3cde
KK
93 (for-each (lambda (h)
94 (install-file h doc))
95 `("License.txt" ,@(find-files "www" ".*\\.html")))
96 (for-each (lambda (b)
97 (install-file b bin))
98 `("delta" "multidelta" "topformflat"))))
99 #t))
139ecdee 100 (delete 'configure)))) ; no configure script
8d809faf
EB
101 (home-page "http://delta.tigris.org/")
102 (synopsis "Heuristical file minimizer")
103 (description
104 "Delta assists you in minimizing \"interesting\" files subject to a test
105of their interestingness. A common such situation is when attempting to
106isolate a small failure-inducing substring of a large input that causes your
107program to exhibit a bug.")
108 ;; See License.txt, which is a bsd-3 license, despite the project's
109 ;; home-page pointing to a bsd-2 license.
c9164d30 110 (license license:bsd-3)))
426fde9a
EB
111
112(define-public c-reduce
113 (package
114 (name "c-reduce")
1d552f63 115 (version "2.10.0")
426fde9a
EB
116 (source
117 (origin
118 (method url-fetch)
119 (uri (list
c23c628e 120 (string-append "http://embed.cs.utah.edu/creduce/"
426fde9a
EB
121 "creduce-" version ".tar.gz")))
122 (sha256
1d552f63 123 (base32 "0qx0zq8jxzx2as2zf0740g7kvgq163ayn3041di4vwk77490y76v"))))
426fde9a 124 (build-system gnu-build-system)
a5a2d79b 125 (native-inputs `(("flex" ,flex)))
426fde9a
EB
126 (inputs
127 `(("astyle" ,astyle)
1d552f63
TGR
128 ("llvm" ,llvm)
129 ("clang" ,clang)
426fde9a
EB
130 ("indent" ,indent)
131 ("perl" ,perl)
426fde9a
EB
132 ("exporter-lite" ,perl-exporter-lite)
133 ("file-which" ,perl-file-which)
134 ("getopt-tabular" ,perl-getopt-tabular)
135 ("regex-common" ,perl-regexp-common)
28f45dd7 136 ("term-readkey" ,perl-term-readkey)))
426fde9a 137 (arguments
dc1d3cde
KK
138 `(#:phases
139 (modify-phases %standard-phases
a6de569e
EB
140 (replace 'check
141 (lambda _
142 (with-directory-excursion "tests"
143 ;; Running all tests can take a looong time, and tests 4 and 5
144 ;; require frama-c or kcc. So run just one for sanity.
145 (invoke "./run_tests" "1"))))
dc1d3cde
KK
146 (add-after 'install 'set-load-paths
147 (lambda* (#:key inputs outputs #:allow-other-keys)
148 ;; Tell creduce where to find the perl modules it needs.
149 (let* ((out (assoc-ref outputs "out"))
150 (prog (string-append out "/bin/creduce")))
151 (wrap-program
152 prog
153 `("PERL5LIB" ":" prefix
154 ,(map (lambda (p)
155 (string-append (assoc-ref inputs p)
156 "/lib/perl5/site_perl/"
157 ,(package-version perl)))
158 '("term-readkey" "exporter-lite"
159 "file-which" "getopt-tabular"
a6de569e 160 "regex-common")))))
dc1d3cde 161 #t)))))
7649e426 162 (home-page "https://embed.cs.utah.edu/creduce")
426fde9a
EB
163 (synopsis "Reducer for interesting code")
164 (description
165 "C-Reduce is a tool that takes a large C or C++ program that has a
166property of interest (such as triggering a compiler bug) and automatically
167produces a much smaller C/C++ program that has the same property. It is
168intended for use by people who discover and report bugs in compilers and other
169tools that process C/C++ code.")
c9164d30 170 (license license:ncsa)))
9b459fc7
EB
171
172(define-public american-fuzzy-lop
173 (let ((machine (match (or (%current-target-system)
174 (%current-system))
175 ("x86_64-linux" "x86_64")
176 ("i686-linux" "i386")
aacefef2
EF
177 ("aarch64-linux" "aarch64")
178 ("armhf-linux" "arm")
179 ("mips64el-linux" "mips64el")
9b459fc7
EB
180 ;; Prevent errors when querying this package on unsupported
181 ;; platforms, e.g. when running "guix package --search="
182 (_ "UNSUPPORTED"))))
183 (package
184 (name "american-fuzzy-lop")
3ba980b1 185 (version "2.56b") ;It seems all releases have the 'b' suffix
9b459fc7
EB
186 (source
187 (origin
3ba980b1
TGR
188 (method git-fetch)
189 (uri (git-reference
190 (url "https://github.com/google/AFL")
191 (commit (string-append "v" version))))
9b459fc7 192 (sha256
3ba980b1
TGR
193 (base32 "1q1g59gkm48aa4cg9h70jx4i2gapmypgp5rzs156b2avd95vwkn1"))
194 (file-name (git-file-name name version))))
9b459fc7
EB
195 (build-system gnu-build-system)
196 (inputs
268efd97 197 `(("qemu" ,qemu-for-american-fuzzy-lop)))
9b459fc7
EB
198 (arguments
199 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
317b13f3
TGR
200 (string-append "DOC_PATH=$(PREFIX)/share/doc/"
201 ,name "-" ,version)
9b459fc7
EB
202 "CC=gcc")
203 #:phases (modify-phases %standard-phases
3ba980b1
TGR
204 (add-after 'unpack 'make-git-checkout-writable
205 (lambda _
206 (for-each make-file-writable (find-files "."))
207 #t))
9b459fc7 208 (delete 'configure)
aacefef2
EF
209 ,@(if (string=? (%current-system) (or "x86_64-linux"
210 "i686-linux"))
211 '()
212 '((add-before 'build 'set-afl-flag
213 (lambda _ (setenv "AFL_NO_X86" "1") #t))
214 (add-after 'install 'remove-x86-programs
215 (lambda* (#:key outputs #:allow-other-keys)
216 (let* ((out (assoc-ref outputs "out"))
217 (bin (string-append out "/bin/")))
218 (delete-file (string-append bin "afl-gcc"))
219 (delete-file (string-append bin "afl-g++"))
220 (delete-file (string-append bin "afl-clang"))
221 (delete-file (string-append bin "afl-clang++")))
222 #t))))
9b459fc7
EB
223 (add-after
224 ;; TODO: Build and install the afl-llvm tool.
225 'install 'install-qemu
226 (lambda* (#:key inputs outputs #:allow-other-keys)
268efd97 227 (let ((qemu (assoc-ref inputs "qemu"))
9b459fc7 228 (out (assoc-ref outputs "out")))
b6d937d9
EB
229 (symlink (string-append qemu "/bin/qemu-" ,machine)
230 (string-append out "/bin/afl-qemu-trace"))
9b459fc7 231 #t)))
3ba980b1 232 (delete 'check)))) ; tests are run during 'install phase
38e1b9ef 233 (home-page "https://lcamtuf.coredump.cx/afl/")
9b459fc7
EB
234 (synopsis "Security-oriented fuzzer")
235 (description
236 "American fuzzy lop is a security-oriented fuzzer that employs a novel
237type of compile-time instrumentation and genetic algorithms to automatically
238discover clean, interesting test cases that trigger new internal states in the
239targeted binary. This substantially improves the functional coverage for the
240fuzzed code. The compact synthesized corpora produced by the tool are also
241useful for seeding other, more labor- or resource-intensive testing regimes
242down the road.")
c9164d30 243 (license license:asl2.0))))
b718bef0 244
268efd97
LF
245(define-public qemu-for-american-fuzzy-lop
246 ;; afl only supports using a single afl-qemu-trace executable, so
247 ;; we only build qemu for the native target.
248 (let ((machine (match (or (%current-target-system)
249 (%current-system))
250 ("x86_64-linux" "x86_64")
251 ("i686-linux" "i386")
252 ("aarch64-linux" "aarch64")
253 ("armhf-linux" "arm")
254 ("mips64el-linux" "mips64el")
255 ;; Prevent errors when querying this package on unsupported
256 ;; platforms, e.g. when running "guix package --search="
257 (_ "UNSUPPORTED"))))
258 (hidden-package
259 (package
260 (name "qemu")
261 (version "2.10.2")
262 (source (origin
263 (method url-fetch)
264 (uri (string-append "https://download.qemu.org/qemu-"
265 version ".tar.xz"))
266 (sha256
267 (base32
268 "17w21spvaxaidi2am5lpsln8yjpyp2zi3s3gc6nsxj5arlgamzgw"))
269 (patches
270 (search-patches "qemu-glibc-2.27.patch"))))
271 (build-system gnu-build-system)
272 (arguments
273 `(;; Running tests in parallel can occasionally lead to failures, like:
274 ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
275 #:parallel-tests? #f
276 #:configure-flags
277 (list (string-append "--target-list=" ,machine "-linux-user"))
278 #:make-flags '("V=1")
279 #:phases
280 (modify-phases %standard-phases
281 (replace 'configure
282 (lambda* (#:key inputs outputs (configure-flags '())
283 #:allow-other-keys)
284 ;; The `configure' script doesn't understand some of the
285 ;; GNU options. Thus, add a new phase that's compatible.
286 (let ((out (assoc-ref outputs "out")))
287 (setenv "SHELL" (which "bash"))
288
289 ;; While we're at it, patch for tests.
290 (substitute* "tests/libqtest.c"
291 (("/bin/sh") (which "sh")))
292
293 ;; The binaries need to be linked against -lrt.
294 (setenv "LDFLAGS" "-lrt")
295 (apply invoke
296 `("./configure"
297 ,(string-append "--cc=" (which "gcc"))
298 ;; Some architectures insist on using HOST_CC
299 ,(string-append "--host-cc=" (which "gcc"))
300 "--disable-debug-info" ; save build space
301 "--enable-virtfs" ; just to be sure
302 ,(string-append "--prefix=" out)
303 ,(string-append "--sysconfdir=/etc")
304 ,@configure-flags)))))
305 (add-after
306 'unpack 'apply-afl-patches
307 (lambda* (#:key inputs #:allow-other-keys)
308 (let* ((afl-src (assoc-ref inputs "afl-source"))
309 (patch-dir "qemu_mode/patches"))
310 (copy-recursively (string-append afl-src "/"
311 patch-dir)
312 patch-dir)
313 (install-file
314 (string-append patch-dir
315 "/afl-qemu-cpu-inl.h")
316 ".")
317 (copy-file (string-append afl-src "/config.h")
318 "./afl-config.h")
319 (install-file (string-append afl-src "/types.h")
320 ".")
321 (substitute* "afl-qemu-cpu-inl.h"
322 (("\\.\\./\\.\\./config.h") "afl-config.h"))
323 (substitute* (string-append patch-dir
324 "/cpu-exec.diff")
325 (("\\.\\./patches/") ""))
326
327 ;; These were already applied to qemu-minimal-2.10.
328 (for-each (lambda (obsolete-patch)
329 (delete-file (string-append
330 patch-dir "/"
331 obsolete-patch)))
332 (list "configure.diff"
333 "memfd.diff"))
334
335 (for-each (lambda (patch-file)
336 (invoke "patch" "--force" "-p1"
337 "--input" patch-file))
338 (find-files patch-dir
339 "\\.diff$"))
340 #t)))
341 (add-before 'check 'disable-unusable-tests
342 (lambda* (#:key inputs outputs #:allow-other-keys)
343 (substitute* "tests/Makefile.include"
344 ;; Comment out the test-qga test, which needs /sys and
345 ;; fails within the build environment.
346 (("check-unit-.* tests/test-qga" all)
347 (string-append "# " all)))
348 (substitute* "tests/Makefile.include"
349 ;; Comment out the test-char test, which needs networking and
350 ;; fails within the build environment.
351 (("check-unit-.* tests/test-char" all)
352 (string-append "# " all)))
353 #t)))))
354 (native-inputs
355 `(("python-2" ,python-2) ; QEMU 2 needs Python 2
356 ("glib:bin" ,glib "bin")
357 ("perl" ,perl)
358 ("flex" ,flex)
359 ("bison" ,bison)
360 ("pkg-config" ,pkg-config)))
361 (inputs
362 `(("afl-source" ,(package-source american-fuzzy-lop))
363 ("alsa-lib" ,alsa-lib)
364 ("attr" ,attr)
365 ("glib" ,glib)
366 ("libaio" ,libaio)
367 ("libattr" ,attr)
368 ("libcap" ,libcap)
369 ("libjpeg" ,libjpeg-turbo)
370 ("libpng" ,libpng)
371 ("ncurses" ,ncurses)
372 ("pixman" ,pixman)
373 ("util-linux" ,util-linux)
374 ("zlib" ,zlib)))
375 (home-page "https://www.qemu.org")
376 (synopsis "Machine emulator and virtualizer (without GUI) for american fuzzy lop")
377 (description
378 "QEMU is a generic machine emulator and virtualizer. This package
379of QEMU is used only by the american fuzzy lop package.
380
381When used as a machine emulator, QEMU can run OSes and programs made for one
382machine (e.g. an ARM board) on a different machine---e.g., your own PC. By
383using dynamic translation, it achieves very good performance.
384
385When used as a virtualizer, QEMU achieves near native performances by
386executing the guest code directly on the host CPU. QEMU supports
387virtualization when executing under the Xen hypervisor or using
388the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
389server and embedded PowerPC, and S390 guests.")
390 ;; Many files are GPLv2+, but some are GPLv2-only---e.g., `memory.c'.
391 (license license:gpl2)
392 ;; Several tests fail on MIPS.
393 (supported-systems (delete "mips64el-linux" %supported-systems))))))
394
b718bef0 395(define-public stress-make
4dfbebdb
EB
396 (let ((commit "97815bed8060de33952475b3498767c91f59ffd9")
397 (revision "2")) ;No official source distribution
b718bef0
EB
398 (package
399 (name "stress-make")
136e3b39 400 (version (git-version "1.0" revision commit))
b718bef0
EB
401 (source
402 (origin
403 (method git-fetch)
404 (uri (git-reference
b0e7b699 405 (url "https://github.com/lanl/stress-make")
b718bef0 406 (commit commit)))
136e3b39 407 (file-name (git-file-name name version))
b718bef0
EB
408 (sha256
409 (base32
4dfbebdb 410 "0k55cy7x0hlc6rgpascl6ibhcfxaash3p9r9r8kwvbm3zag1rmac"))))
b718bef0
EB
411 (build-system gnu-build-system)
412 (native-inputs
413 `(("autoconf" ,autoconf)
414 ("automake" ,automake)
415 ("go" ,go)))
416 (inputs
417 `(("make-source" ,(package-source gnu-make))))
418 (arguments
419 ;; stress-make's configure script insists on having a tarball and does
420 ;; not accept a directory name instead. To let the gnu-build-system's
421 ;; patch-* phases work properly, we unpack the source first, then
422 ;; repack before the configure phase.
05cca6ce 423 (let ((make-dir (string-append "make-" (package-version gnu-make))))
fd466fb8
EB
424 `(#:configure-flags '("--with-make-tar=./make.tar.xz"
425 "make_cv_sys_gnu_glob=yes")
05cca6ce
EB
426 #:phases
427 (modify-phases %standard-phases
428 (add-after 'unpack 'unpack-make
429 (lambda* (#:key inputs #:allow-other-keys)
4aa266a0 430 (invoke "tar" "xf" (assoc-ref inputs "make-source"))))
05cca6ce
EB
431 (add-after 'unpack-make 'set-default-shell
432 (lambda _
433 ;; Taken mostly directly from (@ (gnu packages base) gnu-make)
4dfbebdb 434 (substitute* (string-append ,make-dir "/src/job.c")
05cca6ce
EB
435 (("default_shell = .*$")
436 (format #f "default_shell = \"~a\";\n"
437 (which "sh"))))))
438 (add-before 'configure 'repack-make
439 (lambda _
136e3b39
EB
440 (invoke "tar" "cJf" "./make.tar.xz" ,make-dir)))
441 (add-before 'build 'setup-go
442 ;; The Go cache is required starting in Go 1.12, and it needs
443 ;; to be writable.
444 (lambda _ (setenv "GOCACHE" "/tmp/go-cache") #t))))))
445 (home-page "https://github.com/lanl/stress-make")
b718bef0
EB
446 (synopsis "Expose race conditions in Makefiles")
447 (description
f457397a 448 "Stress Make is a customized GNU Make that explicitly manages the order
a988cbb7
TGR
449in which concurrent jobs are run to provoke erroneous behavior into becoming
450manifest. It can run jobs in the order in which they're launched, in backwards
451order, or in random order. The thought is that if code builds correctly with
452Stress Make, then it is likely that the @code{Makefile} contains no race
453conditions.")
b718bef0
EB
454 ;; stress-make wrapper is under BSD-3-modifications-must-be-indicated,
455 ;; and patched GNU Make is under its own license.
c9164d30
LF
456 (license (list (license:non-copyleft "LICENSE.md")
457 license:gpl3+)))))
660516e8
JD
458
459(define-public zzuf
460 (package
461 (name "zzuf")
462 (version "0.15")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (string-append
467 "https://github.com/samhocevar/zzuf/releases/download/v"
468 version "/" name "-" version ".tar.gz"))
469 (file-name (string-append name "-" version ".tar.gz"))
470 (sha256
471 (base32
472 "1mpzjaksc2qg2hzqflf39pl06p53qam2dn3hkhkcv6p00d2n4kx3"))))
473 (build-system gnu-build-system)
474 (home-page "https://github.com/samhocevar/zzuf")
475 (synopsis "Transparent application input fuzzer")
476 (description "Zzuf is a transparent application input fuzzer. It works by
477intercepting file operations and changing random bits in the program's
478input. Zzuf's behaviour is deterministic, making it easy to reproduce bugs.")
c9164d30 479 (license license:wtfpl2)))
a778f270
P
480
481(define-public scanmem
482 (package
483 (name "scanmem")
484 (version "0.17")
485 (source
486 (origin
487 (method git-fetch)
488 (uri (git-reference
489 (url "https://github.com/scanmem/scanmem")
490 (commit (string-append "v" version))))
491 (file-name (git-file-name name version))
492 (sha256
493 (base32
494 "17p8sh0rj8yqz36ria5bp48c8523zzw3y9g8sbm2jwq7sc27i7s9"))))
495 (build-system gnu-build-system)
f20c64ed
RH
496 (arguments
497 `(#:configure-flags '("--enable-gui")
498 #:phases
499 (modify-phases %standard-phases
500 (add-before 'configure 'hardcode-python
501 (lambda* (#:key inputs outputs #:allow-other-keys)
502 (substitute* "gui/GameConqueror.py"
503 (("/usr/bin/env python")
504 (string-append (assoc-ref %build-inputs
505 "python-wrapper") "/bin/python")))
506 #t))
507 (add-after 'install 'wrap-gameconqueror
508 (lambda* (#:key inputs outputs #:allow-other-keys)
509 (let ((out (assoc-ref outputs "out"))
510 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
511 (python-path (getenv "PYTHONPATH")))
512 (wrap-program (string-append out "/share/gameconqueror/GameConqueror.py")
513 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
514 `("PYTHONPATH" ":" prefix (,python-path))))
515 #t)))))
a778f270
P
516 (native-inputs
517 `(("libtool" ,libtool)
f20c64ed
RH
518 ("python-wrapper" ,python-wrapper)
519 ("gobject-introspection" ,gobject-introspection)
520 ("gtk+" ,gtk+)
a778f270
P
521 ("intltool" ,intltool)
522 ("automake" ,automake)
523 ("autoconf" ,autoconf)))
524 (inputs
525 `(("readline" ,readline)))
f20c64ed
RH
526 (propagated-inputs
527 `(("python-pygobject" ,python-pygobject)))
a778f270
P
528 (home-page "https://github.com/scanmem/scanmem")
529 (synopsis "Memory scanner")
530 (description "Scanmem is a debugging utility designed to isolate the
531address of an arbitrary variable in an executing process. Scanmem simply
532needs to be told the pid of the process and the value of the variable at
533several different times. After several scans of the process, scanmem isolates
534the position of the variable and allows you to modify its value.")
535 ;; The library is covered by LGPLv3 or later; the application is covered
536 ;; by GPLv3 or later.
c9164d30 537 (license (list license:lgpl3+ license:gpl3+))))
8a49e63b 538
86f86cff
EB
539(define-public remake
540 (package (inherit gnu-make)
541 (name "remake")
542 (version "4.3-1.5")
543 (source (origin
544 (method url-fetch)
545 (uri (let ((upstream-version
546 (match (string-split version #\-)
547 ((ver sub) (string-append ver "%2Bdbg-" sub)))))
548 (string-append "mirror://sourceforge/bashdb/"
549 "remake/" upstream-version "/"
550 "remake-" upstream-version ".tar.gz")))
551 (file-name (string-append "remake-" version ".tar.gz"))
552 (sha256
553 (base32
554 "0xlx2485y0israv2pfghmv74lxcv9i5y65agy69mif76yc4vfvif"))
555 (patches (search-patches "remake-impure-dirs.patch"))))
556 (inputs
557 `(("readline" ,readline)
558 ,@(package-inputs gnu-make)))
559 (home-page "http://bashdb.sourceforge.net/remake/")
560 (description "Remake is an enhanced version of GNU Make that adds improved
561error reporting, better tracing, profiling, and a debugger.")
562 (license license:gpl3+)))
563
8a49e63b
LC
564(define-public rr
565 (package
566 (name "rr")
567 (version "5.3.0")
568 (source (origin
569 (method git-fetch)
570 (uri (git-reference
571 (url "https://github.com/mozilla/rr")
572 (commit version)))
573 (sha256
574 (base32
575 "1x6l1xsdksnhz9v50p4r7hhmr077cq20kaywqy1jzdklvkjqzf64"))
576 (file-name (git-file-name name version))))
577 (build-system cmake-build-system)
578 (arguments
579 `(#:configure-flags
580 ;; The 'rr_exec_stub' is a static binary, which leads CMake to fail
581 ;; with:
582 ;;
583 ;; file RPATH_CHANGE could not write new RPATH:
584 ;;
585 ;; Clear CMAKE_INSTALL_RPATH to avoid that problem.
586 (list "-DCMAKE_INSTALL_RPATH="
587 ,@(if (and (not (%current-target-system))
588 (member (%current-system)
589 '("x86_64-linux" "aarch64-linux")))
590 ;; The toolchain doesn't support '-m32'.
591 '("-Ddisable32bit=ON")
592 '()))
593
594 ;; XXX: Most tests fail with:
595 ;;
596 ;; rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
597 ;;
598 ;; This setting cannot be changed from the build environment, so skip
599 ;; the tests.
600 #:tests? #f
601
602 #:phases (modify-phases %standard-phases
603 (add-before 'check 'set-home
604 (lambda _
605 ;; Some tests expect 'HOME' to be set.
606 (setenv "HOME" (getcwd))
607 #t)))))
608 (native-inputs
609 `(("pkg-config" ,pkg-config)
610 ("ninja" ,ninja)
611 ("which" ,which)))
612 (inputs
613 `(("gdb" ,gdb)
614 ("cpanproto" ,capnproto)
615 ("python" ,python)
616 ("python-pexpect" ,python-pexpect)))
617 (home-page "https://rr-project.org/")
618 (synopsis "Record and reply debugging framework")
619 (description
620 "rr is a lightweight tool for recording, replaying and debugging
621execution of applications (trees of processes and threads). Debugging extends
622GDB with very efficient reverse-execution, which in combination with standard
623GDB/x86 features like hardware data watchpoints, makes debugging much more
624fun.")
c9164d30 625 (license license:expat)))
11f1001c
MS
626
627(define-public mspdebug
628 (package
629 (name "mspdebug")
630 (version "0.25")
631 (source (origin
632 (method git-fetch)
633 (uri (git-reference
b0e7b699 634 (url "https://github.com/dlbeer/mspdebug")
11f1001c
MS
635 (commit (string-append "v" version))))
636 (file-name (git-file-name name version))
637 (sha256
638 (base32 "0prgwb5vx6fd4bj12ss1bbb6axj2kjyriyjxqrzd58s5jyyy8d3c"))))
639 (build-system gnu-build-system)
640 (arguments
641 `(#:tests? #f ; no test suite
642 #:phases
643 (modify-phases %standard-phases
644 (delete 'configure)) ; no configure script
645 #:make-flags
646 (list (string-append "CC=" ,(cc-for-target))
647 "INSTALL=install"
648 (string-append "PREFIX=" %output))))
649 (inputs
650 `(("libusb-compat" ,libusb-compat)
651 ("readline" ,readline)))
652 (synopsis "Debugging tool for MSP430 MCUs")
653 (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
654MSP430-JTAG-TINY programmers, as well as many other compatible
655devices. It can be used as a proxy for gdb or as an independent
656debugger with support for programming, disassembly and reverse
657engineering.")
658 (home-page "https://github.com/dlbeer/mspdebug")
659 (license license:gpl2+)))