Community
Participate
Working Groups
Show monitor information inline in the debug view. The information can be turned on/off via a toggle in the view menu "Show Monitor Information". When a thread suspends (and the toggle is on), the first children of a thread will be the "owned" monitors (if any) and "waiting for" monitor (if one). An owned monitor can be expanded to show any threads waiting for the monitor (in contention), and the "waiting for" monitor can be expanded to show its owning thread. Those objects can be recursively expanded to show owned monitors, etc. When a thread suspends its icon overlay can show if it is in contention or in a deadlock. Threads in a deadlock should be emphasized in the UI. Migrating the information to the debug view will make the Threads and Monitors view obsolete.
Implemented. I created a thread & monitor model which represents the current state on the VM. A second model is used to display the information, the debug view and the tree viewer have problems when the same object is display multiple time. The second model create a new object every time a thread or a monitor has to be displayed. The main entry point is the ThreadMonitorManager, which returns the owned and contended monitors for an IJavaThread. I added an action in the drop-down menu of the debug view to turn the thread and monitor support on and off. LaunchViewEventHandler - fixed so the debug view is correctly refresh for debug change event on any element. IJavaObject - added getWaitingThreads() and getOwningThread() to access the monitor information. LogicalObjectStructureValue, JDIObjectValue - implemented the 2 new methods. JDIDebugTarget - added getJDIThread(), to get the JDIThread from a ThreadReference object. JavaDebugContentProvider - updated to return the threads and monitors information if requiered. ThreadMonitorManager - main entry point for the threads and monitors model JavaMonitor, JavaMonitorThread - threads and monitors model. JavaContendedMonitor, JavaOwnedMonitor, JavaWaitingThread, JavaOwningThread - display model. JDIModelPresentation - updated to correctly display the new elements. IJDIPreferenceConstants, JDIDebugUIPreferenceInitializer - added a preference constant and set its default value. ShowMonitorThreadInformation - toggle action to turn the threads and monitors support on and off. thread_and_monitor_obj.gif - icon for the toggle action. plugin.xml, plugin.properties - added the new action
Please verify, Jared.
Verified.