Ritz's debugger approach looks much more thorough and doesn't require invasive extra dependencies as far as I can tell. If I had known it existed, I probably wouldn't have bothered :-). One major weakness of my approach is it doesn't take into account class-unloading through garbage collection of clojure's ethereal classloaders. One way around that would be apply transformations to clojure's dynamic classloaders, and add finalizers to do cleanup, but it seems more trouble than it's worth. The jpda approach looks like what I really want.
Still, it's not clear how to use it. I see a test in https://github.com/pallet/ritz/blob/develop/debugger/test/ritz/jpda/disassemble_test.clj#L90 but it appears to be more fine-grained than just grabbing the class of an object and dumping the bytecode. Before I go down the rabbit-hole, is there anything like that in ritz's code? On Saturday, March 30, 2013 2:31:36 PM UTC-4, Hugo Duncan wrote: > > Gary Trakhman <gary.t...@gmail.com <javascript:>> writes: > > > I made a little proof of concept last night. You could always look at > > bytecode that clojure emits in few ways, you can either hack the > compiler > > yourself, or force AOT in your project and use javap. The first > approach > > is a bit intrusive, and the second has a somewhat annoying turnaround > time, > > and won't work for any code that calls eval at runtime. > > > > This takes another approach. It uses java's Instrumentation stuff, to > > provide a hook into all classloading past the point at which it's > loaded, > > where I store off all the bytes of defined classes into a big > > ConcurrentHashMap. Then I use eclipse.jdt.core's disassembler > > functionality to print out the bytecode. > > The Ritz' disassembler uses jpda to access the bytecode. Not yet ported > to > ritz-nrepl though. > > Hugo > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.