+ (license license:wtfpl2)))
+
+(define-public scanmem
+ (package
+ (name "scanmem")
+ (version "0.17")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/scanmem/scanmem")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "17p8sh0rj8yqz36ria5bp48c8523zzw3y9g8sbm2jwq7sc27i7s9"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:configure-flags '("--enable-gui")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'hardcode-python
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* "gui/GameConqueror.py"
+ (("/usr/bin/env python")
+ (string-append (assoc-ref %build-inputs
+ "python-wrapper") "/bin/python")))
+ #t))
+ (add-after 'install 'wrap-gameconqueror
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
+ (python-path (getenv "PYTHONPATH")))
+ (wrap-program (string-append out "/share/gameconqueror/GameConqueror.py")
+ `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
+ `("PYTHONPATH" ":" prefix (,python-path))))
+ #t)))))
+ (native-inputs
+ `(("libtool" ,libtool)
+ ("python-wrapper" ,python-wrapper)
+ ("gobject-introspection" ,gobject-introspection)
+ ("gtk+" ,gtk+)
+ ("intltool" ,intltool)
+ ("automake" ,automake)
+ ("autoconf" ,autoconf)))
+ (inputs
+ `(("readline" ,readline)))
+ (propagated-inputs
+ `(("python-pygobject" ,python-pygobject)))
+ (home-page "https://github.com/scanmem/scanmem")
+ (synopsis "Memory scanner")
+ (description "Scanmem is a debugging utility designed to isolate the
+address of an arbitrary variable in an executing process. Scanmem simply
+needs to be told the pid of the process and the value of the variable at
+several different times. After several scans of the process, scanmem isolates
+the position of the variable and allows you to modify its value.")
+ ;; The library is covered by LGPLv3 or later; the application is covered
+ ;; by GPLv3 or later.
+ (license (list license:lgpl3+ license:gpl3+))))
+
+(define-public remake
+ (package (inherit gnu-make)
+ (name "remake")
+ (version "4.3-1.5")
+ (source (origin
+ (method url-fetch)
+ (uri (let ((upstream-version
+ (match (string-split version #\-)
+ ((ver sub) (string-append ver "%2Bdbg-" sub)))))
+ (string-append "mirror://sourceforge/bashdb/"
+ "remake/" upstream-version "/"
+ "remake-" upstream-version ".tar.gz")))
+ (file-name (string-append "remake-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0xlx2485y0israv2pfghmv74lxcv9i5y65agy69mif76yc4vfvif"))
+ (patches (search-patches "remake-impure-dirs.patch"))))
+ (inputs
+ `(("readline" ,readline)
+ ,@(package-inputs gnu-make)))
+ (home-page "http://bashdb.sourceforge.net/remake/")
+ (description "Remake is an enhanced version of GNU Make that adds improved
+error reporting, better tracing, profiling, and a debugger.")
+ (license license:gpl3+)))
+
+(define-public rr
+ (package
+ (name "rr")
+ (version "5.3.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mozilla/rr")
+ (commit version)))
+ (sha256
+ (base32
+ "1x6l1xsdksnhz9v50p4r7hhmr077cq20kaywqy1jzdklvkjqzf64"))
+ (file-name (git-file-name name version))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:configure-flags
+ ;; The 'rr_exec_stub' is a static binary, which leads CMake to fail
+ ;; with:
+ ;;
+ ;; file RPATH_CHANGE could not write new RPATH:
+ ;;
+ ;; Clear CMAKE_INSTALL_RPATH to avoid that problem.
+ (list "-DCMAKE_INSTALL_RPATH="
+ ,@(if (and (not (%current-target-system))
+ (member (%current-system)
+ '("x86_64-linux" "aarch64-linux")))
+ ;; The toolchain doesn't support '-m32'.
+ '("-Ddisable32bit=ON")
+ '()))
+
+ ;; XXX: Most tests fail with:
+ ;;
+ ;; rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
+ ;;
+ ;; This setting cannot be changed from the build environment, so skip
+ ;; the tests.
+ #:tests? #f
+
+ #:phases (modify-phases %standard-phases
+ (add-before 'check 'set-home
+ (lambda _
+ ;; Some tests expect 'HOME' to be set.
+ (setenv "HOME" (getcwd))
+ #t)))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("ninja" ,ninja)
+ ("which" ,which)))
+ (inputs
+ `(("gdb" ,gdb)
+ ("cpanproto" ,capnproto)
+ ("python" ,python)
+ ("python-pexpect" ,python-pexpect)))
+ (home-page "https://rr-project.org/")
+ (synopsis "Record and reply debugging framework")
+ (description
+ "rr is a lightweight tool for recording, replaying and debugging
+execution of applications (trees of processes and threads). Debugging extends
+GDB with very efficient reverse-execution, which in combination with standard
+GDB/x86 features like hardware data watchpoints, makes debugging much more
+fun.")
+ (license license:expat)))
+
+(define-public mspdebug
+ (package
+ (name "mspdebug")
+ (version "0.25")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dlbeer/mspdebug")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0prgwb5vx6fd4bj12ss1bbb6axj2kjyriyjxqrzd58s5jyyy8d3c"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; no test suite
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)) ; no configure script
+ #:make-flags
+ (list (string-append "CC=" ,(cc-for-target))
+ "INSTALL=install"
+ (string-append "PREFIX=" %output))))
+ (inputs
+ `(("libusb-compat" ,libusb-compat)
+ ("readline" ,readline)))
+ (synopsis "Debugging tool for MSP430 MCUs")
+ (description "MspDebug supports FET430UIF, eZ430, RF2500 and Olimex
+MSP430-JTAG-TINY programmers, as well as many other compatible
+devices. It can be used as a proxy for gdb or as an independent
+debugger with support for programming, disassembly and reverse
+engineering.")
+ (home-page "https://github.com/dlbeer/mspdebug")
+ (license license:gpl2+)))