From 7495243d34f62daa7d17edcbd6d54a4066ce33b8 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Wed, 8 Jan 2014 16:53:41 -0500 Subject: [PATCH] Contract profiler: support incomplete blame objects. --- pkgs/contract-profile/main.rkt | 2 +- pkgs/contract-profile/utils.rkt | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/contract-profile/main.rkt b/pkgs/contract-profile/main.rkt index d7e5acc8e8..ce98c8bc11 100644 --- a/pkgs/contract-profile/main.rkt +++ b/pkgs/contract-profile/main.rkt @@ -191,7 +191,7 @@ (printf "~a[label=\"~a\"][color=\"~a\"]\n" (hash-ref nodes->names n) n - (if (hash-ref nodes->typed? n) "green" "red"))) + (if (hash-ref nodes->typed? n #f) "green" "red"))) (for ([(k v) (in-hash edge-samples)]) (match-define (cons pos neg) k) (printf "~a -> ~a[label=\"~ams\"]\n" diff --git a/pkgs/contract-profile/utils.rkt b/pkgs/contract-profile/utils.rkt index 89b658048e..3895e09838 100644 --- a/pkgs/contract-profile/utils.rkt +++ b/pkgs/contract-profile/utils.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require racket/port) +(require racket/port racket/contract) (provide (all-defined-out)) @@ -33,3 +33,13 @@ (with-output-to-file file #:exists 'replace (lambda () body ...)))) + +;; for debugging +(define (print-blame b) + (printf (string-append "#\n") + (blame-positive b) (blame-negative b) + (blame-contract b) (blame-value b) (blame-source b)))