diff options
Diffstat (limited to 'gnu/packages/debug.scm')
-rw-r--r-- | gnu/packages/debug.scm | 254 |
1 files changed, 188 insertions, 66 deletions
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index a0345d8278..f244107841 100644 --- a/gnu/packages/debug.scm +++ b/gnu/packages/debug.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com> ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2020, 2021 Morgan Smith <Morgan.J.Smith@outlook.com> -;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2020, 2025 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net> ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com> ;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de> @@ -14,6 +14,8 @@ ;;; Copyright © 2023 Andy Tai <atai@atai.org> ;;; Copyright © 2023 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com> +;;; Copyright © 2025 Nguyễn Gia Phong <mcsinyx@disroot.org> +;;; Copyright © 2025 Robin Templeton <robin@guixotic.coop> ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +41,8 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) #:use-module (guix build-system go) + #:use-module (guix build-system linux-module) + #:use-module (guix build-system pyproject) #:use-module (guix build-system qt) #:use-module (guix gexp) #:use-module (gnu packages) @@ -59,6 +63,9 @@ #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages golang) + #:use-module (gnu packages golang-build) + #:use-module (gnu packages golang-web) + #:use-module (gnu packages golang-xyz) #:use-module (gnu packages image) #:use-module (gnu packages lesstif) #:use-module (gnu packages libusb) @@ -71,6 +78,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages pretty-print) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-check) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) @@ -525,7 +533,7 @@ server and embedded PowerPC, and S390 guests.") (package (inherit american-fuzzy-lop) (name "aflplusplus") - (version "4.32c") + (version "4.33c") (source (origin (method git-fetch) (uri (git-reference @@ -534,7 +542,7 @@ server and embedded PowerPC, and S390 guests.") (file-name (git-file-name name version)) (sha256 (base32 - "1a92mbwk51pih5jb944wqhvmbpy0acpxgvdfbq3c4xw7gisgn5qn")))) + "1h4ya82s1wd11c04r0g0wsq56asl1np3nmsf6yk4vyic9nm0hsq0")))) (arguments (substitute-keyword-arguments (package-arguments american-fuzzy-lop) ((#:make-flags _ ''()) @@ -768,69 +776,99 @@ error reporting, better tracing, profiling, and a debugger.") (license license:gpl3+))) (define-public rr - (package - (name "rr") - (version "5.8.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/mozilla/rr") - (commit version))) - (sha256 - (base32 - "16w6vvvgww4i2f0jk5zlrr6606fj8kps21fnw0pshyw88l141rqn")) - (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=" - ;; Satisfy the ‘validate-runpath’ phase. This isn't a direct - ;; consequence of clearing CMAKE_INSTALL_RPATH. - (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath=" - (assoc-ref %build-inputs "capnproto") - "/lib,-rpath=" (assoc-ref %build-inputs "zlib") - "/lib") - ,@(if (and (not (%current-target-system)) - (member (%current-system) - '("x86_64-linux" "aarch64-linux"))) - ;; The toolchain doesn't support '-m32'. - '("-Ddisable32bit=ON") - '())) + ;; Use a newer commit, which contains unreleased fixes to the + ;; zen-pmu-workaround.c kernel module, among others. + (let ((commit "7fe1e367c2b4e0df7647e020c20d66827badfad3") + (revision "0")) + (package + (name "rr") + (version (git-version "5.9.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mozilla/rr") + (commit commit))) + (sha256 + (base32 + "1zgxk4blwwq0bigi0g8dafgl330aid3kw9ym426825flc3pp1c3m")) + (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=" + ;; Satisfy the ‘validate-runpath’ phase. This isn't a direct + ;; consequence of clearing CMAKE_INSTALL_RPATH. + (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath=" + (assoc-ref %build-inputs "capnproto") + "/lib,-rpath=" (assoc-ref %build-inputs "zlib") + "/lib,-rpath=" (assoc-ref %build-inputs "zstd") + "/lib") + ,@(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 + ;; 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 - (list pkg-config ninja which)) - (inputs - (list gdb capnproto python python-pexpect zlib)) + #:phases (modify-phases %standard-phases + (add-before 'check 'set-home + (lambda _ + ;; Some tests expect 'HOME' to be set. + (setenv "HOME" (getcwd))))))) + (native-inputs + (list lldb pkg-config which)) + (inputs + (list gdb + capnproto + python + python-pexpect + zlib + `(,zstd "lib"))) - ;; List of supported systems according to 'src/preload/raw_syscall.S'. - (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux")) + ;; List of supported systems according to 'src/preload/raw_syscall.S'. + (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux")) - (home-page "https://rr-project.org/") - (synopsis "Record and replay debugging framework") - (description - "rr is a lightweight tool for recording, replaying and debugging + (home-page "https://rr-project.org/") + (synopsis "Record and replay 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))) + (license license:expat)))) + +(define-public rr-zen-pmu-workaround + (package + (name "rr-zen-pmu-workaround") + (version (package-version rr)) + (source (package-source rr)) + (build-system linux-module-build-system) + (arguments + (list + #:tests? #f ;no tests + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'cd + (lambda _ + (chdir "third-party/zen-pmu-workaround")))))) + (home-page "https://github.com/rr-debugger/rr/wiki/Zen") + (synopsis "AMD Zen workaround kernel module for rr") + (description "This is a Linux kernel module that implements + workarounds needed for using the @command{rr} debugger with AMD Zen +@acronym{CPU, Central Processing Unit}.") + (license license:gpl2))) ;GPLv2 only, like the kernel (define-public libbacktrace ;; There are no releases nor tags. @@ -1043,24 +1081,108 @@ to aid in debugging.") (define-public delve (package (name "delve") - (version "1.23.1") + (version "1.25.2") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/go-delve/delve") - (commit (string-append "v" version)))) + (url "https://github.com/go-delve/delve") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 - "1k0ink3jjplbq1si7cnrm7ch6jasnc3y83yksmrwhhbfa1ybk87s")))) + "1b6vp6m4vjx4wfs1djhpizvz40s563jwld9lgjq82svaiilrmlqa")) + (snippet + #~(begin (use-modules (guix build utils)) + (delete-file-recursively "vendor"))))) (build-system go-build-system) (arguments - (list #:import-path "github.com/go-delve/delve/cmd/dlv" - #:unpack-path "github.com/go-delve/delve" - #:install-source? #f - #:phases #~(modify-phases %standard-phases (delete 'check)))) + (list + #:install-source? #f + #:import-path "github.com/go-delve/delve/cmd/dlv" + #:unpack-path "github.com/go-delve/delve" + ;; [1] Want mod github.com/go-delve/delve and dep + ;; github.com/google/go-dap in the output. + ;; [2] Output of go tool nm contains MethodByName. + #:test-flags #~(list "-skip" "TestVersion|TestDeadcodeEliminated"))) + (native-inputs + (list go-github-com-cilium-ebpf + go-github-com-cosiner-argv + go-github-com-creack-pty + go-github-com-derekparker-trie + go-github-com-go-delve-liner + go-github-com-google-go-dap + go-github-com-hashicorp-golang-lru + go-github-com-mattn-go-colorable + go-github-com-mattn-go-isatty + go-github-com-spf13-cobra + go-github-com-spf13-pflag + go-go-starlark-net + go-golang-org-x-arch + go-golang-org-x-sys + go-golang-org-x-telemetry + go-golang-org-x-tools + go-gopkg-in-yaml-v3)) (home-page "https://github.com/go-delve/delve") (synopsis "Debugger for the Go programming language") (description "Delve is a debugger for the Go programming language.") (license license:expat))) + +(define-public fiu + (package + (name "fiu") + (version "1.2") + (source + (origin + (method url-fetch) + (uri (string-append "https://blitiri.com.ar/p/libfiu/files/" + version "/libfiu-" version ".tar.gz")) + (sha256 + (base32 "0x4ncvi6sv22rqi9x61byybpmch0z1zvpr6p48axkk890ysv6fim")))) + (build-system gnu-build-system) + (arguments + (list #:make-flags #~(list (string-append "PREFIX=" #$output) + (string-append "CC=" #$(cc-for-target)) + (string-append "LDFLAGS=-Wl,-rpath=" + #$output "/lib")) + #:phases #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'check 'set-env + ;; Shorten paths to sockets in tests. + (lambda _ (setenv "TMPDIR" "/tmp")))) + #:test-target "test")) + (native-inputs (list python)) ; for tests + (synopsis "Fault injector in userspace") + (description "Fiu provides CLI utilities and a C library +to mark points of failure inside your code +and to enable/disable the failure of those points.") + (home-page "https://blitiri.com.ar/p/libfiu") + (license license:public-domain))) + +(define-public python-fiu + (package + (name "python-fiu") + (version "1.2") + (source (package-source fiu)) + (build-system pyproject-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'enter-python-dir + (lambda _ (chdir "bindings/python"))) + (add-before 'build 'set-env + (lambda* (#:key inputs #:allow-other-keys) + (setenv "PLIBPATH" + (string-append (assoc-ref inputs "fiu") + "/lib"))))) + #:tests? #f)) ; tests run in fiu + (native-inputs (list python-setuptools python-wheel)) + (inputs (list fiu)) + (synopsis "Python binding for fiu (fault injection in userspace)") + (description "This package includes two Python modules: +@enumerate +@item @code{fiu} is a wrapper for @code{libfiu}, the fault injection C library. +@item @code{fiu_ctrl} provide an easy way run a command +with @code{libfiu} enabled, and controlling the failure points dynamically. +@end enumerate") + (home-page (package-home-page fiu)) + (license (package-license fiu)))) |