In this topic

*Methods

*Fields

 

        
         

 


Class Debugger

public final class Debugger
{
  // Fields
  public static final PrintStream out
  public static final int EXEC_MODEL_INTERPRETED;
  public static final int EXEC_MODEL_NATIVE;
  public static final int EXEC_MODEL_COM;
  public static final int EXEC_MODEL_JIT;
  public static final int EXEC_MODEL_FAST_INTERPRETED;

  // Methods
  public static native void breakpoint ();
  public static native boolean isDebugging ();
  public static void setDebugThread (Thread t, boolean candebug);
  public static void setDebugThread (boolean candebug);
  public static boolean isDebugThread (Thread t);
  public static boolean isDebugThread ();
  public static native int getExecutionModelOfCaller (int depth);
  public static native int getInitialExecutionModelOfMethod (java.lang.reflect.Method m);
  public static String ExecutionModeltoString (int em);
  public static String getExecutionModelStringOfCaller (int depth);
  public static String getExecutionModelStringOfCaller ();
}

This class provides methods that set breakpoints and debugging states for threads.

Methods

breakpoint

public static native void breakpoint ();

Causes a breakpoint in the current process at the location of the caller of this function if a debugger is attached.

ExecutionModeltoString

public static String ExecutionModeltoString (int em);

getExecutionModelOfCaller

public static native int getExecutionModelOfCaller (int depth);

Queries the execution model of a caller at the specified stack depth. Returns one of the EXEC_MODEL_XXX fields.

getExecutionModelStringOfCaller

public static String getExecutionModelStringOfCaller (int depth);

getExecutionModelStringOfCaller

public static String getExecutionModelStringOfCaller ();

getInitialExecutionModelOfMethod

public static native int getInitialExecutionModelOfMethod (java.lang.reflect.Method m);

Queries the default execution model of a method. The actual execution model used may vary at any time. Returns one of the EXEC_MODEL_XXX fields.

isDebugging

public static native boolean isDebugging ();

Determines whether a debugger is attached to the current process.

Return Value

Returns true if a debugger is attached.

isDebugThread

public static boolean isDebugThread (Thread t);

Checks the debug state of a thread.

isDebugThread

public static boolean isDebugThread ();

Checks the debug state of the current thread.

setDebugThread

public static void setDebugThread (Thread t, boolean candebug);

Marks or clears the debug state of a thread. If this is set on the thread, debug events, such as exception, breakpoints, and so on, will not trigger the debugger. This state is not re-entrant, that is, a single setDebugThread(false) will undo multiple setDebugThread(true)s.

setDebugThread

public static void setDebugThread (boolean candebug);

Marks or clears the debug state of the current thread.

Fields

EXEC_MODEL_COM
EXEC_MODEL_FAST_INTERPRETED
EXEC_MODEL_INTERPRETED
EXEC_MODEL_JIT
EXEC_MODEL_NATIVE
out
The out field is a stream that is redirected to a debugger, if it is attached. If not, the output is sent to a Win32 debugger through OutputDebugString.