public interface DebuggerUI {

    // NOTES:
    // * variable values always string rather than numeric type for simplicity
    // * currently sends entire stack dump (+ watched variables) each time
    //   breakpoint hit -- efficiency compromise?
    // * consequences of unconstrained expression evaluation?
    // * what if shared memory modified by another thread?
    //   - maybe in MT version just return stack on new src pos, all others on demand?
    // * attaching to a running process?
   
    // update value display for watched variable/memory
    // * standard "::" resolution for structs, unions, classes, namespaces, etc.
    void notifyWatchPtLocal(String var,String new_value);
    void notifyWatchPtGlobal(String var,String new_value);
    void notifyWatchPtResolve(String var_full_resolution_scope,String new_value);
    void notifyWatchMem(int addr_start,int addr_end,char[] data);

    // provide requested contents of memory range (direct request from user)
    void notifyMemoryContents(int addr_start,int addr_end,char[] data);
   
    // provide result of expression evaluation
    void notifyExprEval(String result);
   
    // indicate program now paused at indicated source position (eg.  breakpoint
    // encountered, break curr pos cmd, signal, assert, etc.)
    // * stack should well-formatted stack/frame list (with vars), top first
    //   ex) "int curr(int foo) { local1 val1 local2 { mem1 val1 ... } ... }..."
    //   - all watch variables should be listed after bottom frame
    //   - ":" denotes end of watch variables, start of threads
    // * "expression" version allows fine resolution for multi-expression lines
    //
    void notifyNewSrcPos(String file_full_path,String state,int line);
    void notifyNewSrcPos(String file_full_path,String state,int line,int expression);
    void notifyNewSrcPos(String file_full_path,String state,int line,String reason);
    void notifyNewSrcPos(String file_full_path,String state, int line,int expr,String reason);

    // indicate program has exitted with the given exit code
    void notifyProgramExit(int exit_code);

    // CPP-specific: notify exit due to uncaught exception
    void notifyUnCaughtException(XXXX);

    // maintain thread list
    void notifyThreadCreate(String name);
    void notifyThreadActive(String name);
    void notifyThreadSuspend(String name);
    void notifyThreadDestroy(String name);
   
    // error, info messages from other parts of system
    void notifySystemMsg(String msg);
}

// calls the UI will need to make to another interface (engine?)
public interface DebuggerUIDependancy {
   
    // assume reliable protocol like RMI where ACKs unnecessary
   
    void setWatchPtLocal(String var);
    void setWatchPtGlobal(String var);
    void setWatchPtCpp(String var_full_resolution_scope);
    void setWatchPtMem(int addr_start,int addr_end);
   
    // get contents of memory (for display)
    void getMemContents(int addr_start,int addr_end);

    void setBreakPt(String file_full_path,int line);
    void setBreakPt(String file_full_path,int line,int expression);
    void removeBreakPt(String file_full_path,int line);
    void removeBreakPt(String file_full_path,int line,int expression);
   
    // upon reception, callee should pause program execution, first finishing
    // any instructions corresponding to current src code line being executed
    void breakCurrentPos();
   
    // evaluate expression in context of current call frame
    // REQUIRES: program must be paused prior to call; else ignored
    void evaluateExpression(String expression);

    void runProgram();
    void restartProgram();
    void continueProgram();
    void continueTo(String file_full_path,int line);                // temp bp
    void continueTo(String file_full_path,int line,int expression); // temp bp
    void stepInstruction();
    void terminateProgram();
   
    // switch thread + pause its execution ( see breakCurrentPos() )
    void switchDebugThread(String name);
    void activateThread(String name);
    void suspendThread(String name);
    void destroyThread(String name);
   
    // not sure ramifications...
    void attach(int pid);
    void detach(int pid);

}

// EOF
