views:

39

answers:

2

I have two versions of a project that are intended to accomplish the same effect. One is an older implementation, while the second is an updated, modified, and (hopefully) enhanced version. The issue is that they are not giving identical outputs. Is there an option to have Eclipse print out a list of everything a program is doing such that I can compare them (with some sort of merge/diff tool) and find out where they diverge?

This is in Java, using JBuilder 2008, which is more or less identical to Eclipse.

A: 

I am not familiar with JBuilder. In Eclipse you can right click on a project and click debug to launch the debugger. You can then set your breakpoints on where you want to start debugging from and step through. Is this a web app or a standalone app? If it's a web app running on a server then you may have to do remote debugging.

Here is one link and another link to a tutorial on debugging set up in Eclipse.

CoolBeans
I'm looking more for a GIGANTIC and COMPREHENSIVE list of program flow. I am versed enough in Eclipse debugging to understand the concept of breakpoints, but I'm trying to track down where in a fairly large program these two versions diverge. If I had a list of ALL method calls that occur, I can 'diff' them and find this point much quicker.
Mike
That makes me think that you are looking for the differences in the two versions of the code. In that case you can utilize the subclipse->compare with utility if the code is in subversion. Would that work?
CoolBeans
A: 

The easiest way to do this is probably to use AOP (Aspect Oriented Programming) which allows you to add code in a non-linear way. See this question about logging which I would expect to be very close to what you need, and how simple the AOP approach is.

http://stackoverflow.com/q/1555969/53897

@After("execution(* *.doSomething())")
    public void logAfter(JoinPoint jp){
        logger.debug("...");
    }
Thorbjørn Ravn Andersen