* debug.scm (frame-number->index): Optionally take stack as
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Sat, 11 Sep 1999 18:28:12 +0000 (18:28 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Sat, 11 Sep 1999 18:28:12 +0000 (18:28 +0000)
argument.

ice-9/debug.scm

index 96a2a1d..8923521 100644 (file)
 \f
 ;;; {Misc}
 ;;;
-(define-public (frame-number->index n)
-  (if (memq 'backwards (debug-options))
-      n
-      (- (stack-length (fluid-ref the-last-stack)) n 1)))
+(define-public (frame-number->index n . stack)
+  (let ((stack (if (null? stack)
+                  (fluid-ref the-last-stack)
+                  (car stack))))
+    (if (memq 'backwards (debug-options))
+       n
+       (- (stack-length stack) n 1))))
 
 \f
 ;;; {Trace}