From 850e16c430d1c074453decec8fda952f9871f4a3 Mon Sep 17 00:00:00 2001 From: Juan Monetta Date: Thu, 7 Sep 2023 09:13:13 -0300 Subject: [PATCH] Add multimethod dispatch-val to stack pane --- CHANGELOG.md | 2 ++ src-dbg/flow_storm/debugger/ui/flows/code.clj | 7 +++++-- src-inst/flow_storm/runtime/indexes/api.cljc | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a933553..4098e4b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### New Features + - Add multimethod dispatch-val to stack pane + ### Changes ### Bugs fixed diff --git a/src-dbg/flow_storm/debugger/ui/flows/code.clj b/src-dbg/flow_storm/debugger/ui/flows/code.clj index 91e3fe3c..9fcf6d6d 100644 --- a/src-dbg/flow_storm/debugger/ui/flows/code.clj +++ b/src-dbg/flow_storm/debugger/ui/flows/code.clj @@ -125,8 +125,11 @@ (add-all bindings))) (defn- create-stack-pane [flow-id thread-id] - (let [cell-factory (fn [list-cell {:keys [fn-ns fn-name]}] - (.setGraphic list-cell (label (str fn-ns "/" fn-name) "link-lbl"))) + (let [cell-factory (fn [list-cell {:keys [fn-ns fn-name form-def-kind dispatch-val]}] + (.setGraphic list-cell (label (if (= :defmethod form-def-kind) + (str fn-ns "/" fn-name " " dispatch-val) + (str fn-ns "/" fn-name)) + "link-lbl"))) item-click (fn [mev selected-items _] (let [{:keys [fn-call-idx]} (first selected-items)] (when (= MouseButton/PRIMARY (.getButton mev)) diff --git a/src-inst/flow_storm/runtime/indexes/api.cljc b/src-inst/flow_storm/runtime/indexes/api.cljc index e1d593df..762af538 100644 --- a/src-inst/flow_storm/runtime/indexes/api.cljc +++ b/src-inst/flow_storm/runtime/indexes/api.cljc @@ -247,8 +247,13 @@ (let [{:keys [timeline-index]} (get-thread-indexes flow-id thread-id) {:keys [fn-call-idx-path]} (index-protos/tree-frame-data timeline-index fn-call-idx {:include-path? true})] (reduce (fn [stack fidx] - (conj stack (select-keys (index-protos/tree-frame-data timeline-index fidx {}) - [:fn-ns :fn-name :fn-call-idx]))) + (let [{:keys [fn-name fn-ns fn-call-idx form-id]} (index-protos/tree-frame-data timeline-index fidx {}) + {:keys [form/def-kind multimethod/dispatch-val]} (get-form form-id)] + (conj stack (cond-> {:fn-name fn-name + :fn-ns fn-ns + :fn-call-idx fn-call-idx + :form-def-kind def-kind} + (= def-kind :defmethod) (assoc :dispatch-val dispatch-val))))) [] fn-call-idx-path)))