/* 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 */

/*
 * CirioNubProcs.h
 *
 * Demers, February 25, 1992 1:45:55 pm PST
 *
 * CirioNub remote procedure numbers and descriptions.
 */

#ifndef ←CIRIO←NUB←PROCS←
#define ←CIRIO←NUB←PROCS←

#include "xr/CirioNubProtocol.h"

/*
 * Client CirioNubProcs
 */


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


/*
    unsigned Null ( unsigned desiredVersion );

    Return the "best" Cirio nub version number exported by this nub.
*/

extern CirioNubRetCode
CirioNubServeNull(/* int argc, unsigned *args */);

#define CirioNubProcID←Null			0

/*
    struct { bool sigWasReceived; XR←DBStat dbStat }
	WaitSig ( unsigned timeoutMsec );

    Wait at most timeoutMsec milliseconds for signal from debugee to nub.
*/

extern CirioNubRetCode
CirioNubServeWaitSig(/* int argc, unsigned *args */);

#define CirioNubProcID←WaitSig		1


/*
    int SetDBStat ( XR←DBStat stat, unsigned timeoutMsec );
    
    Set DBStat of debuggee world (all processors).
    Debuggee may refuse; try for no more than the specified time.
    Return ( (success) ? 0 : -1 )
*/

extern CirioNubRetCode
CirioNubServeSetDBStat(/* int argc, unsigned *args */);

#define CirioNubProcID←SetDBStat	2

/*
    Block8 GetBytes ( char *addr, int nBytes ); 

    Read from debuggee address space.
    Return ( (success) ? desired bytes : a null block )
*/

extern CirioNubRetCode
CirioNubServeGetBytes(/* int argc, unsigned *args */);

#define CirioNubProcID←GetBytes		3


/*
    int PutBytes ( char *addr, Block8 bytes );

    Write into debuggee address space.
    Return ( (success) ? 0 : nonzero )
*/

extern CirioNubRetCode
CirioNubServePutBytes(/* int argc, unsigned *args */);

#define CirioNubProcID←PutBytes		4


/*
    Block16 GetWords16 ( char *addr, int nBytes ); 

    Read from debuggee address space.
    Return ( (success) ? desired bytes : a null block )
*/

extern CirioNubRetCode
CirioNubServeGetWords16(/* int argc, unsigned *args */);

#define CirioNubProcID←GetWords16	5


/*
    int PutWords16 ( char *addr, Block16 bytes );

    Write into debuggee address space.
    Return ( (success) ? 0 : nonzero )
*/

extern CirioNubRetCode
CirioNubServePutWords16(/* int argc, unsigned *args */);

#define CirioNubProcID←PutWords16	6


/*
    Block32 GetWords32 ( char *addr, int nBytes ); 

    Read from debuggee address space.
    Return ( (success) ? desired bytes : a null block )
*/

extern CirioNubRetCode
CirioNubServeGetWords32(/* int argc, unsigned *args */);

#define CirioNubProcID←GetWords32	7


/*
    int PutWords32 ( caddr←t addr, Block32 bytes );

    Write into debuggee address space.
    Return ( (success) ? 0 : nonzero )
*/

extern CirioNubRetCode
CirioNubServePutWords32(/* int argc, unsigned *args */);

#define CirioNubProcID←PutWords32	8


/*
    <block of struct CirioNubThreadDataRep>
	GetThreads ( int low, int high );

    Return a struct CirioNubThreadDataRep for each active thread in range.

    Special Case: if (low < 0) return struct CirioNubThreadDataRep for
      thread whose index is (-low), whether active or not.  If (-low) is
      out of range, return an empty block.  Note high is ignored in this case.
*/


extern CirioNubRetCode
CirioNubServeGetThreads(/* int argc, unsigned *args */);

#define CirioNubProcID←GetThreads	9

/*
    struct CirioNubPCInfoRep
    PCtoInfo ( caddr←t addr );

    Map absolute pc to info.
*/

extern CirioNubRetCode
CirioNubServePCtoInfo(/* int argc, unsigned *args */);

#define CirioNubProcID←PCtoInfo		10

/*
	void KillWorld ( );

    Kill the PCR world, cleaning up as much as possible.
    Breaks the Cirio connection after returning.
*/

extern CirioNubRetCode
CirioNubServeKillWorld( );

#define CirioNubProcID←KillWorld		11


/*
    Remote file I/O, WITHDRAWN:		12 ... 17
*/


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

extern CirioNubRetCode
CirioNubServeIssueThreadCommand( );

#define CirioNubProcID←IssueThreadCommand	18


/*
    struct { int dbStat, int examineeIndex; }
    GetDBStat ( int oldstat, int oldExamineeIndex, unsigned timeoutMsec );

    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 old values, or for timeout.
*/

extern CirioNubRetCode
CirioNubServeGetDBStat( );

#define CirioNubProcID←GetDBStat		19


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


/*
    struct CirioNubFileEntryRep
    GetFileEntry ( unsigned seqNum );

    Return file entry with largest seqNum <= the specified one.
    Claim: can't fail.
*/

extern CirioNubRetCode
CirioNubServeGetFileEntry( );

#define CirioNubProcID←GetFileEntry		20


/*
    Procs 21 - 25 are OBSOLETE and will be withdrawn soon ...
      use procs 26-27 instead.

    January 12, 1990 1:01:18 pm PST
    
    
    Isn't it amazing that "soon" still hasn't come?! - ajd
    March 3, 1992 6:41:33 pm PST

*/

/*

    struct LookupSymEntryResultRep {
        int errCode;
        union(errCode) {
            case 0: struct SymEntry symEntry;
            default: void
        }
    };
    
    struct CirioNubLookupSymEntryResultRep
    LookupSymEntryByName(
        char *sym,
        bool caseSensitive,
        bool externOnly,
        int numToSkip
    );
*/

extern CirioNubRetCode
CirioNubServeLookupSymEntryByName( );

#define CirioNubProcID←LookupSymEntryByName		21


/*
    struct LookupSymEntryResult
    LookupSymEntryByValue( unsigned val, int numToSkip );

    (numToSkip == 0) ~ GetLatestByValue
    (numToSkip > 0) ~ GetNextByValue
    (numToSkip < 0) ~ GetPrevByValue
*/

extern CirioNubRetCode
CirioNubServeLookupSymEntryByValue( );

#define CirioNubProcID←LookupSymEntryByValue		22


/*
    struct LookupSymEntryResult
    LookupSymEntryByID( unsigned symID );
*/

extern CirioNubRetCode
CirioNubServeLookupSymEntryByID( );

#define CirioNubProcID←LookupSymEntryByID		23


/*
    struct LookupSymEntryResult
    SkipSymEntryByName(
        unsigned symID,
        bool caseSensitive,
        bool externOnly,
        int numToSkip
    );
*/

extern CirioNubRetCode
CirioNubServeSkipSymEntryByName( );

#define CirioNubProcID←SkipSymEntryByName		24


/*
    struct LookupSymEntryResult
    SkipSymEntryByValue( unsigned symID, int numToSkip );

    (numToSkip > 0) ~ GetNextByValue
    (numToSkip < 0) ~ GetPrevByValue
*/

extern CirioNubRetCode
CirioNubServeSkipSymEntryByValue( );

#define CirioNubProcID←SkipSymEntryByValue		25


/*
    END of the group of obsolete procedures.
*/



/*
    struct LookupSymEntryResult
    GetMatchingSymEntryByName(
        unsigned symID,
        char *pattern,
        bool caseSensitive,
        unsigned wantedTypes,
        unsigned ignoredClasses,
        int numToSkip
    );

    Like XR←ILGetMatchingSymEntryByName
*/

extern CirioNubRetCode
CirioNubServeGetMatchingSymEntryByName( );

#define CirioNubProcID←GetMatchingSymEntryByName	26



/*
    struct LookupSymEntryResult
    GetMatchingSymEntryByValue(
        unsigned symID,
        unsigned val,
        unsigned wantedTypes,
        unsigned ignoredClasses,
        int numToSkip
    );

    Like XR←ILGetMatchingSymEntryByValue
*/

extern CirioNubRetCode
CirioNubServeGetMatchingSymEntryByValue( );

#define CirioNubProcID←GetMatchingSymEntryByValue	27


/*
    unsigned GetMaxThreads ( );

    Return max number of threads supported
        (This is 1 greater than max allowable thread index)
*/

extern CirioNubRetCode
CirioNubServeGetMaxThreads( );

#define CirioNubProcID←GetMaxThreads			28

/*
    struct CirioNubThreadDataRep
        GetThreadFromCTRep ( struct XR←CTRep ctr );

    Return a struct CirioNubThreadDataRep for specified thread on debuggee.
*/


extern CirioNubRetCode
CirioNubServeGetThreadFromCTRep( );

#define CirioNubProcID←GetThreadFromCTRep		29


/*
    struct CirioNubInstrSetAndOpSysRep
        GetInstrSetAndOpSys( );

    Return a struct CirioNubInstrSetAndOpSysRep identifying debuggee's
        instruction set and operating system.
    These are represented as agreed-upon strings.
*/

extern CirioNubRetCode
CirioNubServeGetInstrSetAndOpSys( );

#define CirioNubProcID←GetInstrSetAndOpSys		30



#define CirioNubProcID←Last			30

#endif /* ←CIRIO←NUB←PROCS← */