home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / XFUNCS.H < prev    next >
Text File  |  1996-03-20  |  12KB  |  262 lines

  1. /*****************************************************************************/
  2. /* File:                                             IBM INTERNAL USE ONLY   */
  3. /*   xfuncs.h                                                             827*/
  4. /*                                                                           */
  5. /* Description:                                                              */
  6. /*                                                                           */
  7. /*   ESP function prototypes.                                                */
  8. /*                                                                           */
  9. /* History:                                                                  */
  10. /*                                                                           */
  11. /*   06/23/93 Created.                                                       */
  12. /*... 03/29/94  917   Joe       Ctrl-Break handling for single process.      */
  13. /*... 05/05/94  919   Joe       Add child process support.                   */
  14. /*                                                                           */
  15. /*****************************************************************************/
  16.  
  17. /*---------------------------------------------------------------------------*/
  18. /* xsrvmain.c defined functions.                                             */
  19. /*---------------------------------------------------------------------------*/
  20. #ifdef INCL_MAIN
  21.  int    main( int , char ** );
  22.  void   ParseOptions        ( int, char **, ESP_PARMS *, CONNECTION * );
  23.  void   ParseEspChildOptions( int, char **, ESP_PARMS *, CONNECTION * );
  24.  int    EspParseComPort( char );
  25.  ULONG _System Handler(PEXCEPTIONREPORTRECORD     ,                     /*917*/
  26.                       PEXCEPTIONREGISTRATIONRECORD,                     /*917*/
  27.                       PCONTEXTRECORD              ,                     /*917*/
  28.                       PVOID );                                          /*917*/
  29.  void   PrintCmdMessage( int );                                         /*919*/
  30.  
  31.  ESP_PARMS *GetEspParms( void );
  32.  
  33.  BOOL IsParent      ( void );
  34.  BOOL SingleMultiple( void );
  35.  BOOL IsVerbose     ( void );
  36.  BOOL DosDebugTrace ( void );
  37.  BOOL UseExecPgm    ( void );
  38.  BOOL DebugChild    ( void );
  39. #endif
  40.  
  41. /*---------------------------------------------------------------------------*/
  42. /* rx.c  defined functions.                                                  */
  43. /*---------------------------------------------------------------------------*/
  44. #ifdef INCL_RX
  45.  void RxFindExe(COMMAND);
  46.  void RxStartUser(COMMAND);
  47.  void RxGoInit(COMMAND);
  48.  void RxGoStep(COMMAND);
  49.  void RxGoEntry(COMMAND);
  50.  void RxDefBrk(COMMAND);
  51.  void RxUndBrk(COMMAND);
  52.  void RxPutInBrk(COMMAND);
  53.  void RxPullOutBrk(COMMAND);
  54.  void RxInsertAllBrk( void );
  55.  void RxRemoveAllBrk( void );
  56.  void RxDosDebug(COMMAND );
  57.  void RxGetThreadInfo(COMMAND );
  58.  void RxFreezeThread(COMMAND);
  59.  void RxThawThread(COMMAND);
  60.  void RxGetExeOrDllEntryOrExitPt(COMMAND);
  61.  void RxSetExecAddr( COMMAND );
  62.  void RxGoFast(COMMAND cmd);
  63.  void RxDefWps( COMMAND cmd );
  64.  void RxPutInWps( COMMAND cmd );
  65.  void RxPullOutWps( COMMAND cmd );
  66.  void RxGetDataBytes( COMMAND cmd );
  67.  void RxGetMemBlocks( COMMAND cmd );
  68.  void RxSetExceptions( COMMAND cmd );
  69.  void RxSetExecThread(COMMAND cmd);
  70.  void RxGetCallStack(COMMAND);
  71.  void RxWriteRegs( COMMAND cmd );
  72.  void RxGetCoRegs( COMMAND cmd );
  73.  void RxNormalQuit( COMMAND );
  74.  void RxSetEspRunOpts( COMMAND cmd );
  75.  void RxStartEspQue( COMMAND cmd );
  76. #endif
  77.  
  78. /*---------------------------------------------------------------------------*/
  79. /* xsrvmte.c  defined functions.                                             */
  80. /*---------------------------------------------------------------------------*/
  81. #ifdef INCL_XSRVMTE
  82.  void   AddToModuleLoadTable( UINT**, ULONG, ULONG);
  83.  void   AddFreeToModuleLoadTable( UINT **, ULONG );
  84.  UINT  *GetObjectTable( FILE * , ULONG, ULONG );
  85.  UINT  *PackModuleLoadTable(UINT * , int *);
  86.  UINT  *AddModuleLoadTables(UINT *,int , UINT *,int ,int *);
  87.  void   AddObjTableToList( UINT *, ULONG );
  88.  void   DelObjTableFromList( ULONG );
  89.  UCHAR _GetBitness( ULONG );
  90.  
  91.  ULONG  GetBaseAddr( ULONG );
  92.  ULONG _GetLoadAddr( ULONG , UINT );
  93.  
  94.  OBJTABLEENTRY *GetPtrToObjectTable( ULONG );
  95.  UINT *CoalesceTables( UINT *, int, UINT *, int, int *);
  96.  void  FreeObjectList( void );
  97. #endif
  98.  
  99. /*---------------------------------------------------------------------------*/
  100. /* xsrvbrk.c defined functions.                                              */
  101. /*---------------------------------------------------------------------------*/
  102. #ifdef INCL_XSRVBRK
  103.  BRK  *XSrvDefBrk( ULONG );
  104.  void  XSrvUndBrk( ULONG );
  105.  void  XSrvPutInBrk( ULONG );
  106.  int   XSrvPullOutBrk( ULONG);
  107.  void  XSrvInsertAllBrk(void);
  108.  void  XSrvRemoveAllBrk(void);
  109.  int   XSrvInsertOneBrk(ULONG);
  110.  void  XSrvRemoveOneBrk(ULONG);
  111.  BRK  *GetBrk( ULONG );
  112.  void  ClearBrks( void );
  113.  BRK  *_IfBrkOnAddr( UINT address );
  114. #endif
  115.  
  116. /*---------------------------------------------------------------------------*/
  117. /* xsrvgo.c   defined functions.                                             */
  118. /*---------------------------------------------------------------------------*/
  119. #ifdef INCL_XSRVGO
  120.  APIRET XSrvGoInit( PtraceBuffer *,ULONG*,UINT ** , int* );
  121.  APIRET XSrvRestartAppl( PtraceBuffer *,ULONG*,UINT **, int *, int);
  122.  APIRET XSrvGoStep(PtraceBuffer*,ULONG*,UINT **,int *,ULONG,ULONG,ULONG,int,int);
  123.  APIRET XSrvGoFast( PtraceBuffer *,ULONG *,UINT **,int *,ULONG,int );
  124.  APIRET XSrvNormalQuit( int , UINT , ULONG);
  125.  APIRET XSrvSetExecAddr( ULONG );
  126.  APIRET XSrvWriteRegs(ULONG *,PtraceBuffer *);
  127.  APIRET XSrvGetCoRegs(void * );
  128.  
  129.  APIRET StepOverCall( PtraceBuffer  *, ULONG, UINT **,int *,ULONG,ULONG*,int);
  130.  int    IsCallInst(UINT);
  131.  void   SpinThread( void *);                                            /*919*/
  132.  void   SendNewProcessToQue( USHORT );                                  /*919*/
  133.  void   StuffInModName( ULONG, char *, ULONG);                          /*919*/
  134.  ULONG  GetEspProcessID( void );                                        /*919*/
  135.  ULONG  GetEspSessionID( void );                                        /*919*/
  136.  BOOL   IsChildTerminated( void );
  137.  APIRET GetProcessMte( USHORT , USHORT * );
  138. #endif
  139.  
  140. /*---------------------------------------------------------------------------*/
  141. /* xsrvdis.c defined functions/ subset of disasm.c                           */
  142. /*---------------------------------------------------------------------------*/
  143. #ifdef INCL_XSRVDIS
  144.  UCHAR _InstLength( ULONG );
  145.  void  _GetInstrPacket( UINT, DTIF *);
  146. #endif
  147.  
  148. /*---------------------------------------------------------------------------*/
  149. /* xsrvfile.c defined functions/ subset of fileacc.c                         */
  150. /*---------------------------------------------------------------------------*/
  151. #ifdef INCL_XSRVFILE
  152.  void  *Talloc(UINT);
  153. #endif
  154.  
  155. /*---------------------------------------------------------------------------*/
  156. /* xsrvdbif.c                                                                */
  157. /*---------------------------------------------------------------------------*/
  158. #ifdef INCL_XSRVDBIF
  159.  ULONG    XSrvGetExeOrDllEntryOrExitPt( UINT );
  160.  UCHAR   *XSrvGetMemoryBlock( ULONG , int , int * );
  161.  void    *XSrvGetMemoryBlocks(void * ,int *);
  162.  ULONG    GetExeStackTop(UINT , USHORT *,ULONG *);
  163.  UINT     Putnbytes(ULONG,UINT,UCHAR *);
  164.  UCHAR   *Getnbytes(ULONG,UINT,UINT *);
  165. #endif
  166.  
  167. /*---------------------------------------------------------------------------*/
  168. /* xsrvfexe.c                                                                */
  169. /*---------------------------------------------------------------------------*/
  170. #ifdef INCL_XSRVFEXE
  171.  APIRET XSrvFindExe(char *,char *,UINT );
  172. #endif
  173.  
  174. /*---------------------------------------------------------------------------*/
  175. /* ESPSTART.C                                                                */
  176. /*---------------------------------------------------------------------------*/
  177. #ifdef INCL_ESPSTART
  178.  APIRET EspStartUser(char * ,
  179.                      char * ,
  180.                      USHORT ,
  181.                      ULONG *,
  182.                      ULONG *,
  183.                      ULONG *,
  184.                      ULONG  ,
  185.                      char *);
  186.  
  187.  void   EspSetEspRunOpts( ESP_RUN_OPTS *);
  188.  BOOL   UseExecPgm( void );
  189.  BOOL   DebugChild( void );
  190.  BOOL   IsDebug( char *, USHORT, ULONG *, ULONG *, USHORT * );
  191.  APIRET GetSessionID( USHORT, ULONG * );
  192.  void   PostWait4ChildSema4( void );
  193.  ULONG  GetEspParentProcessID( void );
  194.  ULONG  GetEspParentSessionID( void );
  195.  ULONG  GetTerminateSessionID( void );
  196.  void   SetParentSessionID( ULONG );
  197.  void   SetParentProcessID( ULONG );
  198. #endif
  199.  
  200. /*---------------------------------------------------------------------------*/
  201. /* XSRVTHDS.C                                                                */
  202. /*---------------------------------------------------------------------------*/
  203. #ifdef INCL_XSRVTHDS
  204.  ULONG  XSrvGetThreadInfo( THREADINFO * );
  205.  void   XSrvFreezeThread(ULONG);
  206.  void   XSrvThawThread(ULONG);
  207. #endif
  208.  
  209. /*---------------------------------------------------------------------------*/
  210. /* XSRVUNWD.C                                                                */
  211. /*---------------------------------------------------------------------------*/
  212. #ifdef INCL_XSRVUNWD
  213.  ULONG  XSrvGetCallStack(STACK_PARMS *, UCHAR **, UINT **, UINT ** );
  214.  int    IsFarReturn(UINT);
  215.  int    IsNearReturn(UINT,USHORT);
  216.  UCHAR _InstLengthGlob( UCHAR * , UCHAR );
  217.  UINT  _rollback(UINT ,int ,UINT );
  218.  UINT   CsetThunk(UINT * , UINT * );
  219.  BOOL   IsValid_EBP( ULONG );
  220. #endif
  221.  
  222. /*---------------------------------------------------------------------------*/
  223. /* File : xsrvacvt.c                                                         */
  224. /*---------------------------------------------------------------------------*/
  225. #ifdef INCL_XSRVACVT
  226.  void  Sys_Flat2SelOff (ULONG,USHORT *,USHORT *);
  227.  ULONG Sys_SelOff2Flat (USHORT ,USHORT );
  228. #endif
  229.  
  230. /*---------------------------------------------------------------------------*/
  231. /* File : xsrvwps.c                                                          */
  232. /*---------------------------------------------------------------------------*/
  233. #ifdef INCL_XSRVWPS
  234.  void  XSrvPutInWps( ULONG*);
  235.  void  XSrvDefWps( void *,int );
  236.  void  XSrvPullOutWps( void );
  237.  void  MarkWpNotSet( ULONG );
  238. #endif
  239.  
  240. /*---------------------------------------------------------------------------*/
  241. /* File : xsrvxcpt.c                                                         */
  242. /*---------------------------------------------------------------------------*/
  243. #ifdef INCL_XSRVXCPT
  244.  void   XSrvSetExceptions( UCHAR *, int );
  245.  APIRET XSrvSetExecThread(ULONG *,PtraceBuffer *, UINT );
  246.  int    GetExceptionMap(  int );
  247.  int    GetExceptionIndex( int );
  248.  int    GetExceptionNumber( int );
  249.  char  *GetExceptionType( int );
  250.  ULONG  ResolveException( PtraceBuffer * );
  251. #endif
  252.  
  253. /*---------------------------------------------------------------------------*/
  254. /* File : LOG.C                                                              */
  255. /*---------------------------------------------------------------------------*/
  256. APIRET Dbg(PtraceBuffer *);
  257. void   DumpPtraceBuffer(FILE *,PtraceBuffer *);
  258. void   EspSetEspRunOpts( ESP_RUN_OPTS *);                               /*919*/
  259. void   EspSetDbgTrace( int );                                           /*919*/
  260. ULONG  DbgResolveException(PtraceBuffer *,ULONG *,char **);
  261.  
  262.