Permalink
Browse files

Merge branch 'release/0.2.0'

  • Loading branch information...
2 parents 81946cc + 739d015 commit 869bfe9ac634f4de53f364ce5ee3fc5e217265b8 @hugoduncan hugoduncan committed Oct 20, 2011
View
@@ -0,0 +1,8 @@
+# Ritz Development
+
+## vm's
+
+Setup service names in ~/.pallet/config.clj or ~/.pallet/services/xxx.clj
+
+### ubuntu openjdk
+lein pallet -P service-name converge ritz.vms/ritz-dev-ubuntu 1
View
@@ -11,7 +11,7 @@ This is alpha quality.
## Features
-- Break on uncaught exceptions and breakpoints.
+- Break on exceptions and breakpoints.
- Allows stepping from breakpoints
- Allows evaluation of expressions in the context of a stack frame
- Inspection of locals in any stack frame
@@ -34,22 +34,24 @@ this package to use
### Lein/Cake Project
-Add `[ritz "0.1.7"]` to your project.clj `:dev-dependencies`.
+Add `[ritz "0.2.0"]` to your project.clj `:dev-dependencies`.
### Lein Plugin
-Run `lein plugin install ritz 0.1.7`.
+Run `lein plugin install ritz 0.2.0`.
### Maven Plugin
See [zi](https://github.com/pallet/zi).
-### Sun/Oracle JDK
+### Sun/Oracle JDK and OpenJDK
-To use the Sun/Oracle JDK, you
+To use the Sun/Oracle JDK, and possibly OpenJDK, you
[need to add](http://download.oracle.com/javase/1.5.0/docs/tooldocs/findingclasses.html)
-`tools.jar` from your JDK install to your classpath. If you are using maven then
-there are
+`tools.jar` from your JDK install to your classpath. This is not required on OS
+X, where `tools.jar` does not exist.
+
+If you are using maven then there are
[instructions in the FAQ](http://maven.apache.org/general.html#tools-jar-dependency).
For cake, add the following (with the correct jdk path), to
@@ -60,6 +62,8 @@ For lein, add the tools.jar to the dev-resources-path:
:dev-resources-path "/usr/lib/jvm/java-6-sun/lib/tools.jar"
+If you are missing tools.jar from the classpath, you will see an exception like `java.lang.ClassNotFoundException: com.sun.jdi.VirtualMachine`.
+
### Source Browsing
If you would like to browse into the clojure java sources then add the following
@@ -106,6 +110,19 @@ To list breakpoints, use `M-x slime-list-breakpoints` or press `b` in the
- k remove breakpoint
- v view source location
+### Exception filtering
+
+To filter which exceptions break into the debugger, there is an `IGNORE`
+restart, that will ignore an exception type.
+
+To list breakpoints, use `M-x slime-list-exception-filters` or press `f` in the
+`slime-selector`. In the listing you can use the following keys
+
+ - e enable
+ - d disable
+ - g refresh list
+ - k remove exception filter
+
### Javadoc
Specify the location of local javadoc using `slime-javadoc-local-paths` in
View
@@ -1,6 +1,47 @@
# Release Notes
-Current release is 0.1.7.
+Current release is 0.1.8.
+
+* 0.1.8
+
+- Update readme with section on exception filtering
+
+- Remove java reflection in logging code
+
+- Add exception filters
+ The filters can be set by the IGNORE restart, and can be edited in the
+ slime selector using the 'f key.
+
+- Log issue with inability to send command to connection
+ This occurs on init script processing (not fixed yet)
+
+- Update to recent pallet versions
+
+- Add stone excepetion display
+
+- Put all clojure source dependencies into lein-multi config
+
+- Display pprint of Stone or Condition exceptions
+
+- Update readme to explicitly state the OS X doesn't have tools.jar
+
+- Use clojure.main/with-bindings and flush output
+
+- Factor out repl-utils/io
+
+- Update logback versions and use :local-repo-classpath
+
+- Changes to break-for-exception? and fix swank-clj references
+
+- Normailse function formatting
+
+- Update readme to mention openjdk in tools.jar setup, and list the exception
+ that is raised if tools.jar is missing
+
+- Add note to readme about tools.jar and maven
+
+- Add pallet script to set up a dev environment for ritz
+ Basic tmux, emacs, git install, with clone of ritz repo
* 0.1.7
View
@@ -13,7 +13,7 @@ echo "finish release of $version"
echo -n "commiting project.clj, release notes and readme. enter to continue:" \
&& read x \
-&& git add project.clj ReleaseNotes.md README.md \
+&& git add project.clj ReleaseNotes.md README.md src/main/elisp/slime-ritz.el \
&& git commit -m "Updated project.clj, release notes and readme for $version" \
&& echo -n "Peform release. enter to continue:" && read x \
&& lein test \
View
@@ -1,20 +1,27 @@
-(defproject ritz "0.1.7"
+(defproject ritz "0.2.0"
:description "Another swank server for clojure in SLIME"
:source-path "src/main/clojure"
:resources-path "src/main/resources"
:test-path "src/test/clojure"
:dependencies [[org.clojure/clojure "1.2.1"]
[useful "0.4.0"]]
- :dev-dependencies [[org.clojure/clojure "1.2.1" :classifier "sources"]
- [lein-multi "1.0.0"]]
+ :dev-dependencies [[lein-multi "1.0.0"]
+ [org.cloudhoist/pallet "0.7.0-SNAPSHOT"]
+ [org.cloudhoist/stevedore "0.7.0"]
+ [org.cloudhoist/git "0.7.0-SNAPSHOT"]
+ [org.cloudhoist/java "0.7.0-SNAPSHOT"]
+ [org.cloudhoist/pallet-lein "0.4.2-SNAPSHOT"]
+ [org.slf4j/slf4j-api "1.6.1"]
+ [ch.qos.logback/logback-core "0.9.29"]
+ [ch.qos.logback/logback-classic "0.9.29"]
+ [vmfest "0.2.3"]]
:multi-deps {"1.2.0" [[org.clojure/clojure "1.2.0"]
[clojure-source "1.2.0"]]
- "1.3" [[org.clojure/clojure "1.3.0-master-SNAPSHOT"]
- [org.clojure/clojure "1.3.0-master-SNAPSHOT"
- :classifier "sources"]]
- "1.3.0-alpha8" [[org.clojure/clojure "1.3.0-alpha8"]
- [org.clojure/clojure "1.3.0-alpha8"
- :classifier "sources"]]}
+ "1.2.1" [[org.clojure/clojure "1.2.1"]
+ [org.clojure/clojure "1.2.1" :classifier "sources"]]
+ "1.3" [[org.clojure/clojure "1.3.0"]
+ [org.clojure/clojure "1.3.0" :classifier "sources"]]}
+ :local-repo-classpath true
:repositories
{"sonatype-snapshots" "https://oss.sonatype.org/content/repositories/snapshots"
"sonatype" "https://oss.sonatype.org/content/repositories/releases/"}
@@ -12,6 +12,7 @@
[ritz.repl-utils.find :as find]
[ritz.repl-utils.format :as format]
[ritz.repl-utils.helpers :as helpers]
+ [ritz.repl-utils.io :as io]
[ritz.repl-utils.sys :as sys]
[ritz.repl-utils.trace :as trace]
[ritz.swank.core :as core]
@@ -176,38 +177,12 @@
(defslimefn load-file [connection file-name]
(pr-str (clojure.core/load-file file-name)))
-(defn- line-at-position [file position]
- (try
- (with-open [f (java.io.LineNumberReader. (java.io.FileReader. file))]
- (.skip f position)
- (.getLineNumber f))
- (catch Exception e 1)))
-
-(defn read-position-line [file position]
- (if (number? position)
- (if (.isFile file)
- (line-at-position file position)
- 0)
- (when (list? position)
- (or
- (second (first (filter #(= :line (first %)) position)))
- (when-let [p (second (first (filter #(= :position (first %)) position)))]
- (line-at-position file p))))))
-
-(defn guess-namespace [file]
- (->>
- (reverse (.split (.getParent file) "/"))
- (reductions #(str %1 "." %2))
- (map symbol)
- (filter find-ns)
- first))
-
(defslimefn compile-string-for-emacs
[connection string buffer position buffer-path debug]
(let [start (System/nanoTime)
file (java.io.File. buffer-path)
- line (read-position-line file position)
- ret (binding [*ns* (or (guess-namespace file) *ns*)]
+ line (io/read-position-line file position)
+ ret (binding [*ns* (or (io/guess-namespace file) *ns*)]
(compile/compile-region string buffer-path line))
delta (- (System/nanoTime) start)]
(messages/compilation-result nil ret (/ delta 1000000000.0))))
@@ -69,6 +69,38 @@ corresponding attribute values per thread."
(debug/breakpoint-location
(connection/vm-context connection) breakpoint-id)))
+;;; Exception Filters
+(defslimefn quit-exception-filter-browser [connection])
+
+(defn ^{:private true} exception-filter-data-fn
+ [i {:keys [type location catch-location enabled]}]
+ (list i type location catch-location enabled))
+
+(defslimefn list-exception-filters [connection]
+ "Return a list
+ (LABELS (ID TYPE LOCATION CATCH-LOCATION ENABLED ATTRS ...) ...).
+LABELS is a list of attribute names and the remaining lists are the
+corresponding attribute values per thread."
+ [connection]
+ (let [filters (debug/exception-filter-list @connection)
+ labels '(:id :type :location :catch-location :enabled)]
+ (cons labels (map exception-filter-data-fn (range) filters))))
+
+(defslimefn exception-filter-kill
+ [connection exception-filter-id]
+ (debug/exception-filter-kill connection exception-filter-id)
+ nil)
+
+(defslimefn exception-filter-enable
+ [connection exception-filter-id]
+ (debug/exception-filter-enable connection exception-filter-id)
+ nil)
+
+(defslimefn exception-filter-disable
+ [connection exception-filter-id]
+ (debug/exception-filter-disable connection exception-filter-id)
+ nil)
+
;;; javadoc
(defslimefn javadoc-local-paths
[connection & paths]
@@ -34,7 +34,9 @@
(defn send-to-emacs
"Sends a message (msg) to emacs."
[connection msg]
- (send-to-emacs* @connection msg))
+ (if connection
+ (send-to-emacs* @connection msg)
+ (logging/trace "Unable to send message to nil connection %s" msg)))
(defn read-from-connection
"Read a form from the connection."
@@ -129,15 +131,24 @@
:result-history nil
:last-exception nil
:indent-cache-hash (atom nil)
- :indent-cache (ref {})})))]
+ :indent-cache (ref {})
+ :exception-filters
+ [{:type "clojure.lang.LockingTransaction$RetryEx"
+ :enabled true}
+ {:type "com.google.inject.internal.ErrorsException"
+ :enabled true}
+ {:catch-location #"com.sun.*" :enabled true}
+ {:catch-location #"sun.*" :enabled true}
+ {:catch-location #"ritz.commands.*"
+ :enabled true}]})))]
;;(when-not (:proxy-to options))
- (swap! connection
- (fn [connection]
- (merge connection
- (zipmap
- [:input-redir :input-source :input-tag]
- (make-repl-input-stream connection)))))
+ (swap! connection
+ (fn [connection]
+ (merge connection
+ (zipmap
+ [:input-redir :input-source :input-tag]
+ (make-repl-input-stream connection)))))
;; (logging/trace "connection %s" (pr-str @connection))
connection))
Oops, something went wrong.

0 comments on commit 869bfe9

Please sign in to comment.