Index: /branches/ide-1.0/ccl/lib/backtrace.lisp
===================================================================
--- /branches/ide-1.0/ccl/lib/backtrace.lisp	(revision 6631)
+++ /branches/ide-1.0/ccl/lib/backtrace.lisp	(revision 6632)
@@ -111,4 +111,15 @@
 
 
+;;; Return a list of "interesting" frame addresses in context, most
+;;; recent first.
+(defun %stack-frames-in-context (context &optional (include-internal *backtrace-show-internal-frames*))
+  (collect ((frames))
+    (do* ((p (bt.youngest context) (parent-frame p context))
+          (q (bt.oldest context)))
+         ((= p q) (frames))
+      (when (or (not (catch-csp-p p context)) include-internal)
+        (when (or (cfp-lfun p) include-internal)
+          (frames p))))))
+    
 (defun %print-call-history-internal (context origin detailed-p
                                              &optional (count most-positive-fixnum) (skip-initial 0))
