Martin has posted 1 posts at DZone. View Full User Profile

Easily collect trace from Java programs with the InTrace Eclipse plugin

05.21.2011
| 3508 views |
  • submit to reddit

InTrace is an open source Java tool (and now an Eclipse plugin) for instrumenting Java bytecode at runtime to allow trace to be collected on a per class basis. This means you can quickly generate a log of all the method calls into particular classes along with their arguments and the line numbers of all the branches taken within the methods. This is great for debugging multithreaded code where breakpoints change the behaviouror or large codebases where you don't know the best place to put a breakpoint.

InTrace can be used at the commandline with any Java program. The instrumentation settings and the collected trace can be viewed using the InTrace UI which connects to the InTrace agent over the network allowing you to trace server applications and view the live trace on your desktop.

The new InTrace Eclipse plugin makes it really easy to launch Java Applications and JUnit tests with InTrace enabled from within Eclipse.

When you launch the program, the InTrace UI is loaded within Eclipse and connects to the running program. The launched program is initially paused to allow you to setup the classes which you want to trace.

I have been working on InTrace for about a year now in my spare time and started the Eclipse plugin a couple of weeks ago. Please let me know if you have any suggestions for features you would like to see added or improved.

0
Published at DZone with permission of its author, Martin Robertson.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)