/*
Copyright (c) 1993 Xerox Corporation.  All rights reserved.
*/
/*
 * PCR←RDbg.h
 *
 * Remote debugger procedures.
 */

#ifndef ←←PCR←RDbg←h
#define ←←PCR←RDbg←h


/*
 * Client DebugNubProcs
 */


#define CIRIO←NUB←PROCS←LOW←VERSION 5
#define CIRIO←NUB←PROCS←VERSION	7

typedef void * /* opaque */ PCR←RDbg←Handle;

typedef int PCR←RDbg←ProcID;



#define PCR←RDbg←ProcID←Null	0

PCR←ERes
PCR←RDbg←NullProc(
    PCR←RDbg←Handle h,
    unsigned desiredVersion,
    /* RESULT */
    unsigned *bestVersion
);
/*
    Return "best" protocol version supported by the client.
*/

#define PCR←RDbg←ProcID←GetCallData	1

typedef PCR←ERes
PCR←RDbg←GetCallDataProc(
    PCR←RDbg←Handle h,
    PCR←Msec timeout,
    /* RESULT */
    PCR←RDbg←CallData ** callData
);
/*
    Wait for debuggee thread to call debugger.
    (*callData) will be NIL if no call before timeout.
*/


#define PCR←RDbg←ProcID←RestartCaller	2

typedef PCR←ERes
PCR←RDbg←RestartCallerProc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr thRAddr,
    long ans
);
/*
    Restart the thread represented by thRAddr
      (which must have called the debugger using PCR←Dbg←Call).
    The result of the debuggee's call to PCR←Dbg←Call() will be ans.
*/

#define PCR←RDbg←ProcID←GetWorldStopped	3

typedef PCR←ERes
PCR←RDbg←GetWorldStoppedProc(
    PCR←RDbg←Handle h,
    /* RESULT */
    PCR←Bool * stopped
);
/*
    Determine whether debuggee world is stopped.
*/


#define PCR←RDbg←ProcID←SetWorldStopped	4

typedef PCR←ERes
PCR←RDbg←SetWorldStoppedProc(
    PCR←RDbg←Handle h,
    PCR←Bool stopped
);
/*
    Set debuggee world stopped or not.
    If debuggee is local, the debugger thread is not affected.
    But since the window manager and other important functions
      have their own private threads, this may not help much.
*/


#define PCR←RDbg←ProcID←KillWorld	5

typedef PCR←ERes
PCR←RDbg←KillWorldProc(
    PCR←RDbg←Handle h
);
/*
    Kill the debuggee's world.
    Not advisable locally.
*/


#define PCR←RDbg←ProcID←GetThRAddrs	6

typedef PCR←ERes
PCR←RDbg←GetThRAddrsProc(
    PCR←RDbg←Handle h,
    /* RESULT */
    PCR←RDbg←RAddr ** resRAddrs /* heap-allocated */
);


#define PCR←RDbg←ProcID←SetThFrozen	7

typedef PCR←ERes
PCR←RDbg←SetThFrozenProc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr thRAddr,
    PCR←Bool frozen
);


#define PCR←RDbg←ProcID←GetThData	8

typedef PCR←ERes
PCR←RDbg←GetThDataProc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr thRAddr,
    /* RESULT */
    PCR←RDbg←ThData ** resThData /* heap-allocated */
);


#define PCR←RDbg←ProcID←GetPCData	9

typedef PCR←ERes
PCR←RDbg←GetPCDataProc(
    PCR←RDbg←Handle h,
    void * pc
    /* RESULT */
    PCR←RDbg←PCData ** resPCData
);


??? IssueThreadCommand (
        int threadIndex,
        bool setFreeze, bool freeze,
        bool setMsg, int msg


PCR←ERes
PCR←RDbg←GetFileData(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr lfRAddr
    /* RESULT */
    PCR←RDbg←FileData ** resFileData
);


PCR←ERes
PCR←RDbg←GetSegData(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr lsRAddr
    /* RESULT */
    PCR←RDbg←SegData ** resSegData
);


PCR←ERes
PCR←RDbg←GetSymDataByPattern(
    PCR←RDbg←Handle h,
    const char * pattern,
    PCR←Bool caseSensitive,
    unsigned nSkip,
    /* RESULT */
    PCR←RDbg←SymData ** resSymData
);


PCR←ERes
PCR←RDbg←GetSymDataByValue(
    PCR←RDbg←Handle h,
    void * symVal,
    unsigned nSkip,
    /* RESULT */
    PCR←RDbg←SymData ** resSymData
);


PCR←ERes
PCR←RDbg←GetSymDataByValueReversed(
    PCR←RDbg←Handle h,
    void * symVal,
    unsigned nSkip,
    /* RESULT */
    PCR←RDbg←SymData ** resSymData
);


#define PCR←RDbg←ProcID←GetBlock8	5

typedef PCR←ERes
PCR←RDbg←GetBlock8Proc(
    PCR←RDbg←Handle h,
    char * addr,
    PCR←RDbg←RAddr rAddr,
    unsigned nBytes
);


#define PCR←RDbg←ProcID←GetBlock16	6

typedef PCR←ERes
PCR←RDbg←GetBlock16Proc(
    PCR←RDbg←Handle h,
    short * addr,
    PCR←RDbg←RAddr rAddr,
    unsigned nBytes
);


#define PCR←RDbg←ProcID←GetBlock32	7

typedef PCR←ERes
PCR←RDbg←GetBlock32Proc(
    PCR←RDbg←Handle h,
    long * addr,
    PCR←RDbg←RAddr rAddr,
    unsigned nBytes
);


#define PCR←RDbg←ProcID←GetBlock64	8

typedef PCR←ERes
PCR←RDbg←GetBlock64Proc(
    PCR←RDbg←Handle h,
    void * addr,
    PCR←RDbg←RAddr rAddr,
    unsigned nBytes
);



#define PCR←RDbg←ProcID←PutBlock8	9

typedef PCR←ERes
PCR←RDbg←PutBlock8Proc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr rAddr,
    char * addr,
    unsigned nBytes
);


#define PCR←RDbg←ProcID←PutBlock16	10

typedef PCR←ERes
PCR←RDbg←PutBlock16Proc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr rAddr,
    short * addr,
    unsigned nBytes
);


#define PCR←RDbg←ProcID←PutBlock32	11

typedef PCR←ERes
PCR←RDbg←PutBlock32Proc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr rAddr,
    long * addr,
    unsigned nBytes
);


#define PCR←RDbg←ProcID←PutBlock64	12 ???

typedef PCR←ERes
PCR←RDbg←PutBlock64Proc(
    PCR←RDbg←Handle h,
    PCR←RDbg←RAddr rAddr,
    void * addr,
    unsigned nBytes
);




PCR←ERes
PCR←RDbg←GetDebuggeeData(
    PCR←RDbg←Handle h,
    /* RESULT */
    PCR←RDbg←DebuggeeData ** debuggeeData
);




#endif /* ←←PCR←DbgNubProcs←h */