Eclipse Debugging Method Calls
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 (w开发者_开发技巧ith 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.
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.
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.
Traditional logging vs AOP logging
@After("execution(* *.doSomething())")
public void logAfter(JoinPoint jp){
logger.debug("...");
}
精彩评论