/* begincopyright
  Copyright (c) 1988 Xerox Corporation. All rights reserved.
  Use and copying of this software and preparation of derivative works based
  upon this software are permitted. Any distribution of this software or
  derivative works must comply with all applicable United States export
  control laws. This software is made available AS IS, and Xerox Corporation
  makes no warranty about the software, its performance or its conformity to
  any specification. Any person obtaining a copy of this software is requested
  to send their name and post office or electronic mail address to:
    PCR Coordinator
    Xerox PARC
    3333 Coyote Hill Rd.
    Palo Alto, CA 94304
  endcopyright */

/*
 * RDTProcs.h
 *
 * Demers, February 25, 1992 12:08:46 pm PST
 *
 * RemoteDebugTool procedure descriptions.
 */

#ifndef ←RDT←PROCS←
#define ←RDT←PROCS←

#include <cirio/CirioNubProtocol.h>

#define RDT←PROCS←VERSION 7
/* WARNING -- needs to be updated for non-SPARC-SunOS debuggees */

extern int /* -err */
RDT←Null(/* unsigned desiredVersion, unsigned *resultVersionPtr */);
/*
    Set *resultVersionPtr to "best" Cirionub version number exported by nub.
*/

extern int /* 0, 1, -err */
RDT←WaitSig(/* unsigned timeoutMsec, int *dbStatP */);
/*
    Wait at most timeoutMsec milliseconds for signal from debugee to nub.
    Set *dbStatP to debuggee's dbStat value.
    Return 0 (got sig), 1 (timed out), <0 (err)
*/

extern int /* -err */
RDT←SetDBStat (/* int dbStat, unsigned timeoutMsec */);
/*
    Set DBStat of debuggee world (all processors).
    Debuggee may refuse; try for no more than the specified time.
    Return 0 (okay), 1 (timeout), <0 (fatal error)
*/

extern int /* bytesRead or -err */
RDT←GetBytes(/* unsigned addr, unsigned nBytes, char *buf */);
/*
    Read from debuggee address space.
*/


extern int /* bytesWritten or -err */
RDT←PutBytes (/* unsigned addr, unsigned nBytes, char *buf */);
/*
    Write into debuggee address space.
*/


extern int /* bytesRead or -err */
RDT←GetWords16 (/* unsigned addr, int nBytes, unsigned short *buf */); 
/*
    Read from debuggee address space.
*/


extern int /* bytesWritten or -err */
RDT←PutWords16 (/* unsigned addr, unsigned nBytes, unsigned short *buf */); 
/*
    Write into debuggee address space.
*/

extern int /* bytesRead or -errno */
RDT←GetWords32 (/* unsigned addr, int nBytes, unsigned *buf */); 
/*
    Read from debuggee address space.
*/


extern int /* bytesWritten or -errno */
RDT←PutWords32 (/* unsigned addr, int nBytes, unsigned *buf */); 
/*
    Write into debuggee address space.
*/



extern int /* -err */
RDT←GetThread(/* int index, CirioNubThreadData *dataPtr */);
/*
    Get data about thread of specified index.
    Allocate a CirioNubThreadDataRep and store its address in *dataPtr. 
    Return 0 (success), 1 (index out of range), <0 (fatal err)
*/

extern void
RDT←FreeThreadData(/* CirioNubThreadData *dataPtr */);
/*
    Free the object **dataPtr and its descendants.
    Set *dataPtr = NIL.
*/

extern int /* -err */
RDT←PCtoInfo (/* unsigned pc, CirioNubPCInfo *infoPtr */);
/*
    Map absolute pc to info.
    Allocate a CirioNubPCInfoRep and store its address in *infoPtr.
*/

extern void
RDT←FreePCInfo(/* CirioNubPCInfo *infoPtr */);
/*
    Free the object **dataPtr and its descendants.
    Set *dataPtr = NIL.
*/

extern int /* -err */
RDT←KillWorld ( );
/*
    Kill the debuggee PCR world, cleaning up as much as possible.
    Break the connection after returning.
*/

extern int /* -err */
RDT←IssueThreadCommand (/*
    int threadIndex,
    bool setFreeze, bool freeze,
    bool setMsg, int msg
*/);
/*  
    Set dbFreeze and dbMsg fields of specified thread.
    Return ( success ? 0 : nonzero ).
*/

extern int /* 0, 1, -err */
RDT←GetDBStat (/* unsigned timeoutMsec, int *indexPtr, int *dbStatPtr */); 
/*
    Return system dbStat value and index of thread currently being
      examined (for dbx).  Index < 0 ==> no thread being examined.
    Wait for the values to change from the initial values, or for timeout.
    Return 0 (okay), 1 (timeout), <0 (fatal err)
*/


/*
 * For the following procs, consult IncrementalLoad.h
 */


extern int /* -err */
RDT←GetFileEntry(/* unsigned seqNum, CirioNubFileEntry *fileEntryPtr */);
/*
    Get file entry with largest seqNum <= the specified one.
    Allocate a CirioNubFileEntryRep and store its address in *fileEntryPtr.
*/


extern void
RDT←FreeFileEntry(/* CirioNubFileEntry *fileEntryPtr */);
/*
    Free the object **fileEntryPtr and its descendants.
    Set *fileEntryPtr = NIL.
*/


extern int /* -err */
RDT←GetMatchingSymEntryByName(/*
    unsigned symID,
    char *pattern,
    bool caseSensitive,
    unsigned wantedTypes,
    unsigned ignoredClasses,
    int numToSkip,
    CirioNubSymEntry *symEntryPtr
*/);
/*
    Like XR←ILGetMatchingSymEntryByName
    Allocates a CirioNubSymEntryRep and stores it in *symEntryPtr.
    If symbol not found, sets *symEntryPtr = NIL.
*/


extern int /* -err */
RDT←GetMatchingSymEntryByValue(/*
    unsigned symID,
    unsigned val,
    unsigned wantedTypes,
    unsigned ignoredClasses,
    int numToSkip,
    CirioNubSymEntry *symEntryPtr
*/);
/*
    Like XR←ILGetMatchingSymEntryByValue.
*/

extern void
RDT←FreeSymEntry(/* CirioNubSymEntry *symEntryPtr */);
/*
    Free the object **symEntryPtr and its descendants.
    Set *symEntryPtr = NIL.
*/


#endif /* ←RDT←PROCS← */