diff options
Diffstat (limited to 'gnu/packages/debug.scm')
-rw-r--r-- | gnu/packages/debug.scm | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index 2f58f8e972..9dc32c70f4 100644 --- a/gnu/packages/debug.scm +++ b/gnu/packages/debug.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2019 Pkill -9 <pkill9@runbox.com> ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com> +;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,6 +37,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bison) + #:use-module (gnu packages c) #:use-module (gnu packages code) #:use-module (gnu packages compression) #:use-module (gnu packages flex) @@ -624,6 +626,78 @@ GDB/x86 features like hardware data watchpoints, makes debugging much more fun.") (license license:expat))) +(define-public libbacktrace + ;; There are no releases nor tags. + (let ((revision "1") + (commit "5009c113981431ae1843ebd29d6ad24eb32fc1b2")) + (package + (name "libbacktrace") + (version (git-version "1.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ianlancetaylor/libbacktrace") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0663zjpfpnsyv9h3pbp7cgmg9gz79n68bqpdl97y6i0jsx93v1zg")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags '("CFLAGS=-fPIC"))) + (home-page "https://github.com/ianlancetaylor/libbacktrace") + (synopsis "C library for producing symbolic backtraces") + (description "The @code{libbacktrace} library can be linked into a C/C++ +program to produce symbolic backtraces.") + (license license:bsd-3)))) + +(define-public libleak + (package + (name "libleak") + (version "0.3.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/WuBingzheng/libleak") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1p8mb0hcfp8hdv1klv6rrpkn2zlhjxgkxbbjsk8kszxv7ijln87d")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ;no test suite + #:parallel-build? #f ;jobserver unavailable + #:phases (modify-phases %standard-phases + (add-after 'unpack 'unbundle-libwuya + (lambda _ + (substitute* "Makefile" + ((".*make -C libwuya.*") "")) + #t)) + (add-before 'build 'set-CC + (lambda _ + (setenv "CC" "gcc") + #t)) + (delete 'configure) ;no configure script + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (install-file "libleak.so" (string-append out "/lib")) + #t)))))) + (inputs `(("libbacktrace" ,libbacktrace) + ("libwuya" ,libwuya))) + (home-page "https://github.com/WuBingzheng/libleak") + (synopsis "Memory leaks detection tool") + (description "The libleak tool detects memory leaks by hooking memory +functions such as @code{malloc}. It comes as a shared object to be pre-loaded +via @code{LD_PRELOAD} when launching the application. It prints the full call +stack at suspicious memory leak points. Modifying or recompiling the target +program is not required, and the detection can be enabled or disabled while +the target application is running. The overhead incurred by libleak is +smaller than that of other tools such as Valgrind, and it aims to be easier to +use than similar tools like @command{mtrace}.") + (license license:gpl2+))) + (define-public mspdebug (package (name "mspdebug") |