lejos.nxt.debug
Class DebugInterface

java.lang.Object
  extended by lejos.nxt.debug.DebugInterface

public class DebugInterface
extends Object

This class provides the primary interface to the debug capabilities of leJOS. it provides an event based mechanism that allows Java applications to wait for debug events from the VM.

Author:
andy

Field Summary
static int DBG_EVENT_DISABLE
           
static int DBG_EVENT_ENABLE
           
static int DBG_EVENT_IGNORE
           
static int DBG_EXCEPTION
           
static int DBG_NONE
           
static int DBG_PROGRAM_EXIT
           
static int DBG_USER_INTERRUPT
           
 Throwable exception
           
 int method
           
 int pc
           
 Thread[] systemThreads
           
 Thread thread
           
 int typ
           
 
Method Summary
 void clearEvent()
          Clear the reported event.
static DebugInterface get()
           
 void recordSystemThreads()
          Take a snapshot of the current set of threads.
 void resumeProgram()
          Allow the monitored program to continue running.
 void resumeSystemThreads()
          Resume essential system threads.
 int setEventOptions(int event, int option)
          Allow events to be enabled/disabled/ignored.
 int startProgram(int progId)
          Start a program to be monitored, running in a new thread.
 int waitEvent(int millis)
          Wait for a debug event from the kernel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBG_NONE

public static final int DBG_NONE
See Also:
Constant Field Values

DBG_EXCEPTION

public static final int DBG_EXCEPTION
See Also:
Constant Field Values

DBG_USER_INTERRUPT

public static final int DBG_USER_INTERRUPT
See Also:
Constant Field Values

DBG_PROGRAM_EXIT

public static final int DBG_PROGRAM_EXIT
See Also:
Constant Field Values

DBG_EVENT_DISABLE

public static final int DBG_EVENT_DISABLE
See Also:
Constant Field Values

DBG_EVENT_ENABLE

public static final int DBG_EVENT_ENABLE
See Also:
Constant Field Values

DBG_EVENT_IGNORE

public static final int DBG_EVENT_IGNORE
See Also:
Constant Field Values

typ

public int typ

exception

public Throwable exception

thread

public Thread thread

method

public int method

pc

public int pc

systemThreads

public Thread[] systemThreads
Method Detail

get

public static DebugInterface get()

clearEvent

public void clearEvent()
Clear the reported event.


waitEvent

public final int waitEvent(int millis)
Wait for a debug event from the kernel

Parameters:
millis - wait for at most millis milliseconds. 0 = forever.
Returns:
The new debug event

recordSystemThreads

public void recordSystemThreads()
Take a snapshot of the current set of threads. These threads will be resumed by a call to resumeSystemThreads. These threads are typically required to perform I/O etc, and may be needed to allow the debug code to communicate with a host system.


startProgram

public final int startProgram(int progId)
Start a program to be monitored, running in a new thread.

Parameters:
progId - The program number
Returns:
the status

resumeProgram

public void resumeProgram()
Allow the monitored program to continue running.


resumeSystemThreads

public void resumeSystemThreads()
Resume essential system threads.


setEventOptions

public int setEventOptions(int event,
                           int option)
Allow events to be enabled/disabled/ignored. Disabled events will return to the default behaviour. Enabled events will be reported via this interface. Ignored events will be discarded.

Parameters:
event -
option -
Returns:
previous state of this event.