Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

Commit

Permalink
added force-continue
Browse files Browse the repository at this point in the history
  • Loading branch information
George Jahad committed Mar 27, 2011
1 parent 30612bb commit 52bd4e4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/swank/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ values."

(= action :emacs-interrupt)
(let [[thread & args] args]
(force-continue)
(dosync
(cond
(and (true? thread) (seq @active-threads))
Expand Down
16 changes: 15 additions & 1 deletion src/swank/core/cdt_backends.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,29 @@
(:use swank.core.debugger-backends
[swank.commands :only [defslimefn]]))

(defmethod force-continue :cdt []
(.deleteEventRequests
(.eventRequestManager (cdt/vm))
(.exceptionRequests (.eventRequestManager (cdt/vm))))
(cdt/continue-vm))

(defn backend-init []
(reset! dispatch-val :cdt)
(cdt/cdt-attach-pid)
(cdt/set-handler cdt/exception-handler cutils/default-handler)
(cdt/set-handler cdt/breakpoint-handler cutils/default-handler)
(cdt/set-handler cdt/step-handler cutils/default-handler)
(cdt/create-thread-start-request)
(reset! cdt/CDT-DISPLAY-MSG cutils/display-background-msg)
(cutils/set-control-thread)
(cutils/set-system-thread-groups))
(cutils/set-system-thread-groups)

;; this invocation of force-continue is only needed to force the loading
;; of the classes required by force-continue because inadvertently
;; catching an exception which happens to be in the classloader can cause a
;; deadlock

(force-continue))

(defmethod swank-eval :cdt [form]
(cdt/safe-reval (:thread *debugger-env*)
Expand Down
2 changes: 1 addition & 1 deletion src/swank/core/cdt_utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
(defn default-handler [e]
(when-not @control-thread
(set-control-thread))
(if-not (exception-event? e)
(if-not (cdt/exception-event? e)
(send-to-control-thread e)
(if (@exception-events (.exception e))
(cdt/continue-thread (cdt/get-thread e))
Expand Down
9 changes: 7 additions & 2 deletions src/swank/core/debugger_backends.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
(defn get-debugger-backend [& args]
(when *debugger-env* :cdt))

(def dispatch-val (atom :default))

(defn dbe-dispatch [& args]
@dispatch-val)

(defmacro def-backend-multimethods [methods]
`(do
~@(for [m methods]
Expand All @@ -16,6 +21,6 @@
build-backtrace eval-string-in-frame step get-stack-trace
next finish continue swank-eval handled-exception? debugger-exception?])

(defmulti line-bp (constantly :cdt))

(defmulti line-bp dbe-dispatch)
(defmulti force-continue dbe-dispatch)

0 comments on commit 52bd4e4

Please sign in to comment.