Meaningless Drivel is fun!*
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
Author

Debugging Java

Saahil Bhat
Greenhorn

Joined: Apr 28, 2008
Posts: 3
Hi,

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

Thanks.
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
Greenhorn

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
Greenhorn

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
Sheriff

Joined: Oct 27, 2005
Posts: 19693
    
  20

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


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Debugging Java