Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
<title>Show Monitors</title>
</head>
<body>
<h1> Show Monitors </h1>
<p> Select the <strong>Show Monitors </strong> command [ <img src="../../../images/org.eclipse.jdt.debug.ui/obj16/thread_and_monitor_obj.png" alt="Show Monitors"> ] to change if monitor information will be shown for suspended threads.</p>
<p>Note: The display of monitor information must be supported by the underlying VM. If using an IBM or SUN VM, any version greater than 1.4 will support monitor information.</p>
<p>Consider the following code example:</p>
<pre>
/**
 * Hello World
 */
public class HelloWorld {


	 public static void main(String[] args) {
		Object mutex = new Object();
		synchronized (mutex) {
			System.out.println("Hello World!");
		}
	 }
} 
</pre>
<p>If the above code snippet is run on a supporting VM with <strong>Show Monitors</strong> selected, the monitor information is represented as a 'key' and appearing before any stack frames as a child of a suspended thread. </p>
<p><img src="../../../reference/views/debug/images/ref-monitors_supported.PNG" alt="Monitor Information"></p>
<p>If however, we run the same snippet on an unsupported VM with <strong>Show Monitors</strong> selected, we are alerted that monitor information is not supported by the VM. </p>
<p><img src="../../../reference/views/debug/images/ref-monitors_unsupported.PNG" alt="Monitors Not Supported"></p>
<p> <img border="0" src="../../../images/ngrelc.png" alt="Related concepts" > </p>
<p> <a href="../../../concepts/cdebugger.htm">Debugger</a><br>
  <a href="../../../concepts/clocdbug.htm">Local debugging</a><br>
  <a href="../../../concepts/cremdbug.htm">Remote debugging</a> </p>
<p> <img border="0" src="../../../images/ngrelt.png" alt="Related tasks" > </p>
<p> <a href="../../../tasks/tasks-9.htm">Changing debugger launch options</a><br>
  <a href="../../../tasks/task-remotejava_launch_config.htm">Connecting to a remote VM with the Remote Java application launch configuration</a><br>
  <a href="../../../tasks/task-disconnect_remote_debug.htm">Disconnecting from a VM</a><br>
  <a href="../../../tasks/task-launching_java_program.htm">Launching a Java program</a><br>
  <a href="../../../tasks/task-preparing_to_debug.htm">Preparing to debug</a><br>
  <a href="../../../tasks/task-resuming_threads.htm">Resuming the execution of suspended threads</a><br>
  <a href="../../../tasks/task-running_and_debugging.htm">Running and debugging</a><br>
  <a href="../../../tasks/task-stepping.htm">Stepping through the execution of a program</a><br>
  <a href="../../../tasks/task-suspending_threads.htm">Suspending threads</a> </p>
<p> <img border="0" src="../../../images/ngrelr.png" alt="Related reference" > </p>
<p> <a href="../../../reference/views/debug/ref-debug_view.htm">Debug View</a><br>
  <a href="../../preferences/run-debug/ref-run_debug.htm">Debug preferences</a><br>
  <a href="../../../reference/views/debug/ref-showsystemthreads.htm">Show System Threads</a><br>
  <a href="../../../reference/views/debug/ref-showthreadgroups.htm">Show Thread Groups</a></p>
</body>
</html>
New to GrepCode? Check out our FAQ X