Changeset 6686


Ignore:
Timestamp:
Jun 8, 2007, 3:17:27 PM (17 years ago)
Author:
Gary Byers
Message:

Report conditions in the event process at most once.
Use defstatic for process-interrupt IDs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ide-1.0/ccl/examples/cocoa-window.lisp

    r6612 r6686  
    6161                 :void))
    6262
    63 (defvar *appkit-process-interrupt-ids* (make-id-map))
     63(defstatic *appkit-process-interrupt-ids* (make-id-map))
    6464(defun register-appkit-process-interrupt (thunk)
    6565  (assign-id-map-id *appkit-process-interrupt-ids* thunk))
     
    112112(defparameter *debug-in-event-process* t)
    113113
     114(defparameter *event-process-reported-conditions* () "Things that we've already complained about on this event cycle.")
     115
    114116(defmethod process-debug-condition ((process appkit-process) condition frame-pointer)
    115117  "Better than nothing.  Not much better."
    116118  (when *debug-in-event-process*
    117     (catch 'need-a-catch-frame-for-backtrace
    118       (let* ((*debug-in-event-process* nil)
    119              (context (new-backtrace-info nil
    120                                           frame-pointer
    121                                           (if *backtrace-contexts*
    122                                             (or (child-frame
    123                                                  (bt.youngest (car *backtrace-contexts*))
    124                                                  nil)
     119    (let* ((c (if (typep condition 'ns-lisp-exception)
     120                (ns-lisp-exception-condition condition)
     121                condition)))
     122      (unless (member c *event-process-reported-conditions*)
     123        (catch 'need-a-catch-frame-for-backtrace
     124          (let* ((*debug-in-event-process* nil)
     125                 (context (new-backtrace-info nil
     126                                              frame-pointer
     127                                              (if *backtrace-contexts*
     128                                                (or (child-frame
     129                                                     (bt.youngest (car *backtrace-contexts*))
     130                                                     nil)
     131                                                    (last-frame-ptr))
    125132                                                (last-frame-ptr))
    126                                             (last-frame-ptr))
    127                                           (%current-tcr)
    128                                           condition
    129                                           (%current-frame-ptr)
    130                                           #+ppc-target *fake-stack-frames*
    131                                           #+x86-target (%current-frame-ptr)
    132                                           (db-link)
    133                                           (1+ *break-level*)))
    134              (*backtrace-contexts* (cons context *backtrace-contexts*))) 
    135         (format t "~%~%*** Error in event process: ~a~%~%" condition)
    136         (print-call-history :context context :detailed-p t :count 20 :origin frame-pointer)
    137         (format t "~%~%~%")
    138         (force-output t)
    139         ))))
     133                                              (%current-tcr)
     134                                              condition
     135                                              (%current-frame-ptr)
     136                                              #+ppc-target *fake-stack-frames*
     137                                              #+x86-target (%current-frame-ptr)
     138                                              (db-link)
     139                                              (1+ *break-level*)))
     140                 (*backtrace-contexts* (cons context *backtrace-contexts*))) 
     141            (format t "~%~%*** Error in event process: ~a~%~%" condition)
     142            (print-call-history :context context :detailed-p t :count 20 :origin frame-pointer)
     143            (format t "~%~%~%")
     144            (force-output t)
     145            ))))))
    140146
    141147
     
    186192  (let* ((app *NSApp*))
    187193    (loop
    188         (handler-case (#/run app)
     194        (handler-case (let* ((*event-process-reported-conditions* nil))
     195                        (#/run app))
    189196          (error (c) (nslog-condition c)))
    190197        (unless (#/isRunning app)
Note: See TracChangeset for help on using the changeset viewer.