Skip to content
Browse files

add inspection of locals in backtrace frame

  • Loading branch information...
1 parent 365f88d commit c7cd73989185de6bbd3bfa6df8c48baf1c3f4c7f @hugoduncan hugoduncan committed Mar 9, 2010
Showing with 10 additions and 4 deletions.
  1. +1 −4 src/swank/commands/basic.clj
  2. +6 −0 src/swank/commands/inspector.clj
  3. +3 −0 src/swank/core.clj
View
5 src/swank/commands/basic.clj
@@ -353,15 +353,12 @@ that symbols accessible in the current namespace go first."
(defslimefn buffer-first-change [file-name] nil)
-(defn local-non-functions [m]
- (select-keys m (filter #(or (coll? (m %)) (not (ifn? (m %)))) (keys m))))
-
(defn locals-for-emacs [m]
(map #(list :name (name (first %)) :id 0 :value (str (second %))) m))
(defslimefn frame-catch-tags-for-emacs [n] nil)
(defslimefn frame-locals-for-emacs [n]
- (if (and (zero? 0) *current-env*)
+ (if (and (zero? n) *current-env*)
(locals-for-emacs (local-non-functions *current-env*))))
(defslimefn frame-locals-and-catch-tags [n]
View
6 src/swank/commands/inspector.clj
@@ -264,6 +264,12 @@
(binding [*current-connection* (first @*connections*)]
(send-it))))))
+(defslimefn inspect-frame-var [frame index]
+ (if (and (zero? frame) *current-env*)
+ (let [locals (local-non-functions *current-env*)
+ object (locals (nth (keys locals) index))]
+ (inspect-object object))))
+
(defslimefn inspector-nth-part [index]
(get @*inspectee-parts* index))
View
3 src/swank/core.clj
@@ -104,6 +104,9 @@
(let [symbols (keys &env)]
(zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols)))))
+(defn local-non-functions [m]
+ (select-keys m (filter #(or (coll? (m %)) (not (ifn? (m %)))) (keys m))))
+
(defn exception-stacktrace [t]
(map #(list %1 %2 '(:restartable nil))
(iterate inc 0)

0 comments on commit c7cd739

Please sign in to comment.
Something went wrong with that request. Please try again.