Community
Participate
Working Groups
I'm trying to debug some asynchronous code in an Eclipse plugin, where a Job is created on one thread and ultimately executed in another. I have currently the debugger stopped at a line of code in an executing Job, which is deadlocked waiting for another blocking job. In order to understand how it ended up in this state, I would like to understand the flow of how those Jobs were created. However, because they were created and executed asynchronously, the logical flow of how they were created is not in the stack trace of any one thread - it has been lost. It is very difficult to step back through the history of the logical flow. I think it would be an extremely nifty feature if the JDT debugger could keep track of object instantiations, and kept a reference to the stack trace information for the thread for the line of code that instantiated them. This information could be stored and then displayed when you introspect the object's properties. It is possible that such a feature would significantly slow down the execution of code being debugged. This could be mitigated by allowing you to selectively enable it for certain classes rather than for all classes (off by default). Forgive me if such a feature or plugin already exists. I did try to do a search before raising this feature request.
Even if they are asynchronous threads, you can add watch points for the objects and you can specify if it stops on access/modify of the object. And when it stops we can access the stacktrace. Also a profiler like Yourkit does track threads and their stacktraces. Adding that inbuilt with Eclipse is a lot of work and if some one is ready to contribute, we can look into it.