From 01fc783e7f2527e7f712ea8fd2965f829bb61a53 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Tue, 2 Dec 2008 12:26:05 +0000 Subject: [PATCH] added debug functions tracing function arguments and result svn path=/nixpkgs/trunk/; revision=13540 --- pkgs/lib/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index 0a8dc6623e5..fe5b7fb1427 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -577,6 +577,11 @@ rec { else if (x == false) then "x is boolean false" else if (x == null) then "x is null" else "x is probably a string starting, starting characters: ${__substring 0 50 x}.."; + # trace the arguments passed to function and its result + traceCall = n : f : a : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a)); + traceCall2 = n : f : a : b : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b)); + traceCall3 = n : f : a : b : c : let t = n2 : x : traceMarked "${n} ${n2}:" x; in t "result" (f (t "arg 1" a) (t "arg 2" b) (t "arg 3" c)); + innerClosePropagation = ready: list: if list == [] then ready else