sybase.asa.procdebug.IDebugAPI interface

You can write scripts to control debugger behavior. Scripts are Java classes that use the IDebugAPI interface to control the debugger.

The IDebugAPI interfaces is as follows:

package sybase.asa.procdebug;
import java.util.*;
public interface IDebugAPI

{
    // Simulate Menu Items 

    IDebugWindow MenuOpenSourceWindow() throws DebugError;
    IDebugWindow MenuOpenCallsWindow() throws DebugError;
    IDebugWindow MenuOpenClassesWindow() throws DebugError;
    IDebugWindow MenuOpenClassListWindow() throws DebugError;
    IDebugWindow MenuOpenMethodsWindow() throws DebugError;
    IDebugWindow MenuOpenStaticsWindow() throws DebugError;
    IDebugWindow MenuOpenCatchWindow() throws DebugError;
    IDebugWindow MenuOpenProcWindow() throws DebugError;
    IDebugWindow MenuOpenOutputWindow() throws DebugError;
    IDebugWindow MenuOpenBreakWindow() throws DebugError;
    IDebugWindow MenuOpenLocalsWindow() throws DebugError;
    IDebugWindow MenuOpenInspectWindow() throws DebugError;
    IDebugWindow MenuOpenRowVarWindow() throws DebugError;
    IDebugWindow MenuOpenQueryWindow() throws DebugError;
    IDebugWindow MenuOpenEvaluateWindow() throws DebugError;
    IDebugWindow MenuOpenGlobalsWindow() throws DebugError;
    IDebugWindow MenuOpenConnectionWindow() throws DebugError;
    IDebugWindow MenuOpenThreadsWindow() throws DebugError;
    IDebugWindow GetWindow( String name ) throws DebugError;

    void MenuRunRestart() throws DebugError;
    void MenuRunHome() throws DebugError;
    void MenuRunGo() throws DebugError;
    void MenuRunToCursor() throws DebugError;
    void MenuRunInterrupt() throws DebugError;
    void MenuRunOver() throws DebugError;
    void MenuRunInto() throws DebugError;
    void MenuRunIntoSpecial() throws DebugError;
    void MenuRunOut() throws DebugError;
    void MenuStackUp() throws DebugError;
    void MenuStackDown() throws DebugError;
    void MenuStackBottom() throws DebugError;
    void MenuFileExit() throws DebugError;
    void MenuFileOpen( String name ) throws DebugError;
    void MenuFileAddSourcePath( String what ) throws DebugError;
    void MenuSettingsLoadState( String file ) throws DebugError;
    void MenuSettingsSaveState( String file ) throws DebugError;
    void MenuWindowTile() throws DebugError;
    void MenuWindowCascade() throws DebugError;
    void MenuWindowRefresh() throws DebugError;
    void MenuHelpWindow() throws DebugError;
    void MenuHelpContents() throws DebugError;
    void MenuHelpIndex() throws DebugError;
    void MenuHelpAbout() throws DebugError;
    void MenuBreakAtCursor() throws DebugError;
    void MenuBreakClearAll() throws DebugError;
    void MenuBreakEnableAll() throws DebugError;
    void MenuBreakDisableAll() throws DebugError;
    void MenuSearchFind( IDebugWindow w, String what ) throws DebugError;
    void MenuSearchNext( IDebugWindow w ) throws DebugError;
    void MenuSearchPrev( IDebugWindow w ) throws DebugError;
    void MenuConnectionLogin() throws DebugError;
    void MenuConnectionReleaseSelected() throws DebugError;

    // output window
    void OutputClear();
    void OutputLine( String line );
    void OutputLineNoUpdate( String line );
    void OutputUpdate();

    // Java source search path 

    void SetSourcePath( String path ) throws DebugError;
    String GetSourcePath() throws DebugError;

    // Catch java exceptions 
    Vector GetCatching();
    void Catch( boolean on, String name ) throws DebugError;

    // Database connections 
    int  ConnectionCount();
    void ConnectionRelease( int index );
    void ConnectionAttach( int index );
    String ConnectionName( int index );
    void ConnectionSelect( int index );

    // Login to database 
    boolean LoggedIn();
    void Login( String url, String userId, String password, String userToDebug ) throws DebugError;
    void Logout();

    // Simulate keyboard/mouse actions 
    void DeleteItemAt( IDebugWindow w, int row ) throws DebugError;
    void DoubleClickOn( IDebugWindow w, int row ) throws DebugError;

    // Breakpoints 
    Object BreakSet( String where ) throws DebugError;
    void  BreakClear( Object b ) throws DebugError;
    void BreakEnable( Object b, boolean enabled ) throws DebugError;
    void BreakSetCount( Object b, int count ) throws DebugError;
    int  BreakGetCount( Object b ) throws DebugError;
    void BreakSetCondition( Object b, String condition ) throws DebugError;
    String BreakGetCondition( Object b ) throws DebugError;
    Vector GetBreaks() throws DebugError;

    // Scripting 
    void RunScript( String args[] ) throws DebugError;
    void AddEventHandler( DebugScript s );
    void RemoveEventHandler( DebugScript s );

    // Miscellaneous 
    void EvalRun( String expr ) throws DebugError;
    void QueryRun( String query ) throws DebugError;
    void QueryMoreRows() throws DebugError;
    Vector GetClassNames();
    Vector GetProcedureNames();
    Vector WindowContents( IDebugWindow window ) throws DebugError;
    boolean AtBreak();
    boolean IsRunning();
    boolean AtStackTop();
    boolean AtStackBottom();
    void SetStatusText( String msg );
    String GetStatusText();
    void WaitCursor();
    void OldCursor();
    void Error( Exception x );
    void Error( String msg );
    void Warning( String msg );
    String Ask( String title );
    boolean MenuIsChecked( String cmd );
    void MenuSetChecked( String cmd, boolean on );
    void AddInspectItem( String s ) throws DebugError;

    // Constants for DebugScript.OnEvent parameter 
    public static final int EventBreak = 0;
    public static final int EventTerminate = 1;
    public static final int EventStep = 2;
    public static final int EventInterrupt = 3;
    public static final int EventException = 4;
    public static final int EventConnect = 5;
};