Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging Java

 
Saahil Bhat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Saahil Bhat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at AspectJ. With it you can add code to be executed at the start of every method without actually rewriting anything.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic