Hi!

This patch fixes a problem with the ",c" toplevel csi command when
the last exception was not a normal "property" condition. So, e.g.
something like

#;> (signal 1)
#;> ,c

would trigger an error message instead of showing the call trace.

Thanks to "rgherdt", who reported this in #chicken.


felix


From ea6b018a376c8106422ab1470b5b74909bc357e7 Mon Sep 17 00:00:00 2001
From: felix <fe...@call-with-current-continuation.org>
Date: Mon, 6 Jul 2020 15:32:13 +0200
Subject: [PATCH] Make sure ##sys#repl-recent-call-chain is always set.

---
 repl.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/repl.scm b/repl.scm
index 3fa2d3a2..b102b08f 100644
--- a/repl.scm
+++ b/repl.scm
@@ -128,15 +128,15 @@
                       (##sys#write-char-0 #\newline ##sys#standard-error)
                       (write-err args)))
                 (set! ##sys#repl-recent-call-chain
-                  (or (and-let* ((lexn ##sys#last-exception) ;XXX not really 
right
-                                 ((##sys#structure? lexn 'condition))
-                                 (a (member '(exn . call-chain) (##sys#slot 
lexn 2))))
-                        (let ((ct (cadr a)))
-                          (##sys#really-print-call-chain
-                           ##sys#standard-error ct
-                           "\n\tCall history:\n")
-                          ct))
-                      (print-call-chain ##sys#standard-error)))
+                  (let ((ct (or (and-let* ((lexn ##sys#last-exception) ;XXX 
not really right
+                                          ((##sys#structure? lexn 'condition))
+                                          (a (member '(exn . call-chain) 
(##sys#slot lexn 2))))
+                                  (cadr a))
+                                 (get-call-chain 0 ##sys#current-thread))))
+                    (##sys#really-print-call-chain
+                      ##sys#standard-error ct
+                      "\n\tCall history:\n")
+                    ct))
                 (flush-output ##sys#standard-error))))
            (lambda ()
              (let loop ()
-- 
2.24.2

Reply via email to