Markus Barchfeld wrote:
If you have to implement the debugee's part of the protocol entirely
from scratch or can reuse eclipseDebug.rb, depends on how compatible
JRuby is with Ruby:
Does JRuby provide
... trace callbacks with set_trace_proc (see my last post this list)?
... access to thread information?
... bindings and eval?
On implementing this: instead of adding special tracing code to all
JRuby interpreter code,
it would be possible to use bytecode instrumentation to to achieve that,
ie. determine the places
where tracing and other code must go and simply add the bytecodes for it.
The Eclipse TPTP project has the Probekit tools, which allow you to
easily instrument bytecode.
Take a look at this screencast:
http://www.eclipse.org/tptp/home/documents/tutorials/screencasts/ProbekitEditor_viewlet_swf.html
(skip over the first 10%, as that's a bit boring, the juicer bits come
afterwards).
It allows you to define the code - that is to be injected into classes -
using normal Java code, and also
facilitates the access to various information (methodName, className,
etc. etc.).
The Probekit also makes it very easy to target specific classes,
methods, etc, so the changes aren't applied to everything,
only the interesting bits.
The Probekit GUI is an Eclipse plugin (comes with TPTP), but the
instrumented code is completely independet
of Eclipse or TPTP. You simply point your defined Probes at classes or
Jar files and the Probekit generates instrumented
classes.
The benefits:
- the support code for tracing can be developed without changing the
JRuby sources
- you can ship versions with/without debugging enabled; using Eclipses
HotSwap these could also be interchanged at runtime;
I tried messing with it and instrumenting JRuby so I could trace the
methods that were run, but I couldn't figure out
which Java methods/systems to monitor for this information, so I put
that on hold for the moment.
If you think about it, this approach could also be used to write a
low-overhead Profiler for JRuby
(one that could be turned on/off using HotCodeReplacement).
murphee
--
Blog @ http://jroller.com/page/murphee
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Rubyeclipse-development mailing list
Rubyeclipse-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rubyeclipse-development