de.enough.polish.emulator
Class Debugger

java.lang.Object
  extended by de.enough.polish.Extension
      extended by de.enough.polish.emulator.Debugger
Direct Known Subclasses:
AntCallDebugger, DefaultDebugger

public abstract class Debugger
extends Extension

Connects the emulator to a debugger.

Copyright Enough Software 2005

 history
        27-Oct-2005 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Field Summary
 
Fields inherited from class de.enough.polish.Extension
antProject, autoStartCondition, environment, extensionDefinition, extensionManager, extensionSetting, extensionTypeDefinition, isBuildStarted
 
Constructor Summary
Debugger()
          Creates a new debugger.
 
Method Summary
 void addDebugArguments(Environment env, List argsList)
          Adds the debugging settings to the arguments list.
abstract  void connectDebugger(int port, Device device, Locale locale, Environment env)
          Connects to a debugger interface.
 void execute(Device device, Locale locale, Environment env)
          Executes this extension.
 String getXRunJdwpCommandLine(DebuggerSetting setting)
           
 
Methods inherited from class de.enough.polish.Extension
configure, executeAntTarget, executeAntTarget, finalize, getAntProject, getAutoStartCondition, getEnvironment, getExtensionDefinition, getExtensionSetting, getInstance, getParameterValue, getType, init, initialize, isConditionFulfilled, notifyBuildEnd, notifyBuildStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Debugger

public Debugger()
Creates a new debugger.

Method Detail

execute

public void execute(Device device,
                    Locale locale,
                    Environment env)
             throws BuildException
Description copied from class: Extension
Executes this extension. Not all extension types are executed.

Specified by:
execute in class Extension
Parameters:
device - the current device
locale - the current locale, can be null
env - the environment/configuration
Throws:
BuildException - when the execution failed

connectDebugger

public abstract void connectDebugger(int port,
                                     Device device,
                                     Locale locale,
                                     Environment env)
Connects to a debugger interface.

Parameters:
port - the port in which the emulator listens
device - the current device
locale - the current locale
env - the environment

addDebugArguments

public void addDebugArguments(Environment env,
                              List argsList)
Adds the debugging settings to the arguments list. By default the UEI arguments -Xdebug and -Xrunjdwp arguments are added by calling debugger.addDebugArguments( List ), unless the "polish.debug.commandline" variable is defined. The "debug.commandline" variable can be defined in one of the device database files (devices.xml, vendors.xml, etc) or in the &l;variables&g; section of the build.xml script. Several arguments can be defined by separating them with two semicolons (;;). Addtionally the "polish.debug.port" settings can be used, this is set by the "port" attribute of the <debugger> element. The following example sets the same arguments as the default UEI arguments:
 <capability 
     name="polish.debug.commandline"
     value="-Xdebug;;-Xrunjdwp:address=${polish.debug.port},transport=dt_socket,server=y,suspend=n"
 />
 

Parameters:
env - the environment settings.
argsList - the arguments list

getXRunJdwpCommandLine

public String getXRunJdwpCommandLine(DebuggerSetting setting)