diff --git a/CHANGELOG.md b/CHANGELOG.md index 944c413f..498d5fd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## master (unreleased) ### New Features + + - Add configurable auto jump to exceptions ### Changes diff --git a/docs/user_guide.adoc b/docs/user_guide.adoc index 43b30eaa..dfb3d72c 100644 --- a/docs/user_guide.adoc +++ b/docs/user_guide.adoc @@ -865,6 +865,9 @@ together with the exceptions types. If you hover the mouse over any of them, a t Clicking on any of them will position the stepper at that point in time so you can explore what happened before. +You can configure FlowStorm to automatically jump to exceptions with the `Config` menu by checking `Auto jump to exception` +which is disabled by default. + === Locals The locals panel will always show the locals bounded for the current point in time. diff --git a/docs/user_guide.html b/docs/user_guide.html index e5ee4bd0..7fcd788c 100644 --- a/docs/user_guide.html +++ b/docs/user_guide.html @@ -2145,6 +2145,10 @@

<

Clicking on any of them will position the stepper at that point in time so you can explore what happened before.

+
+

You can configure FlowStorm to automatically jump to exceptions with the Config menu by checking Auto jump to exception +which is disabled by default.

+

3.1.6. Locals

@@ -4214,7 +4218,7 @@

diff --git a/src-dbg/flow_storm/debugger/events_processor.clj b/src-dbg/flow_storm/debugger/events_processor.clj index ba1615ce..64746e6a 100644 --- a/src-dbg/flow_storm/debugger/events_processor.clj +++ b/src-dbg/flow_storm/debugger/events_processor.clj @@ -108,7 +108,8 @@ (ui-utils/run-later (flows-screen/update-exceptions-combo flow-id) ;; the first time we encounter an exception, navigate to that location - (when (= 1 (count (dbg-state/flow-exceptions flow-id))) + (when (and (:auto-jump-on-exception? (dbg-state/debugger-config)) + (= 1 (count (dbg-state/flow-exceptions flow-id)))) (flows-screen/goto-location unwind-data))))) (defn data-window-push-val-data-event [{:keys [dw-id val-data root?]}] diff --git a/src-dbg/flow_storm/debugger/state.clj b/src-dbg/flow_storm/debugger/state.clj index a8da95cb..b0cc4209 100644 --- a/src-dbg/flow_storm/debugger/state.clj +++ b/src-dbg/flow_storm/debugger/state.clj @@ -171,12 +171,14 @@ (s/def :config/debugger-ws-port int?) (s/def :config/runtime-host string?) (s/def :config/debug-mode? boolean?) +(s/def :config/auto-jump-on-exception? boolean?) (s/def ::debugger-config (s/keys :req-un [:config/repl :config/debugger-host :config/debugger-ws-port :config/runtime-host - :config/debug-mode?])) + :config/debug-mode? + :config/auto-jump-on-exception?])) (s/def :bookmark/id (s/tuple :flow/id :thread/id int?)) (s/def ::bookmarks (s/map-of :bookmark/id string?)) @@ -257,7 +259,8 @@ :debugger-host (or debugger-host "localhost") :debugger-ws-port (or ws-port 7722) :runtime-host (or runtime-host "localhost") - :debug-mode? false} + :debug-mode? false + :auto-jump-on-exception? false} :bookmarks {} :visualizers {} :data-windows {}}) @@ -300,6 +303,9 @@ (defn debugger-config [] (get @state :debugger-config)) +(defn set-auto-jump-on-exception [enable?] + (swap! state assoc-in [:debugger-config :auto-jump-on-exception?] enable?)) + (defn toggle-debug-mode [] (swap! state update-in [:debugger-config :debug-mode?] not)) diff --git a/src-dbg/flow_storm/debugger/ui/main.clj b/src-dbg/flow_storm/debugger/ui/main.clj index eac76958..c2b7cdd4 100644 --- a/src-dbg/flow_storm/debugger/ui/main.clj +++ b/src-dbg/flow_storm/debugger/ui/main.clj @@ -243,7 +243,10 @@ :on-click (fn [] (goto-file-line))}]) config-menu (ui/menu :label "_Config" :items [{:text "Set threads limit" - :on-click (fn [] (ask-and-set-threads-limit))}]) + :on-click (fn [] (ask-and-set-threads-limit))} + {:text "Auto jump to exceptions" + :check-item? true + :on-click (fn [enable?] (dbg-state/set-auto-jump-on-exception enable?))}]) help-menu (ui/menu :label "_Help" :items [{:text "Tutorial" :on-click (fn []