File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Debugging Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Debugging Java " Watch "Debugging Java " New topic

Debugging Java

Saahil Bhat

Joined: Apr 28, 2008
Posts: 3

Is it possible to execute a java application in debug mode , such that all the methods that get called during the course of application execution get printed out to the console.
I tried the -verbose option but this is of least help because it just prints out the class names that are getting loaded but not the stacktrace.\

In eclipse I can set the breakpoints and monitor, but what i want is that somehow I should get the complete stack trace from beginning to end displayed on the console

Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
No, I don't think there is any such feature.

It doesn't sound like a very good debugging approach, anyway. What are you trying to achieve? Perhaps there is a better way?

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Saahil Bhat

Joined: Apr 28, 2008
Posts: 3
Well, what I want is, to understand the flow of the application in terms of the classes and the methods that are involved (in one particular use case) and the sequence in which they are called.

One way is to put in hundreds of breakpoints and then monitor, but I was just thinking that there should be someway of logging the entire stack trace somewhere.
Saahil Bhat

Joined: Apr 28, 2008
Posts: 3
Just to add to it, I tried out using the -XDebug and attaching an external debugger but am yet to taste success with this approach as well.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20274

Take a look at AspectJ. With it you can add code to be executed at the start of every method without actually rewriting anything.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Debugging Java
It's not a secret anymore!