home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / som30tk.zip / som30os2.zip / include / somdebug.h < prev    next >
C/C++ Source or Header  |  1996-12-24  |  4KB  |  115 lines

  1. /* @(#) 1.3 src/somk/somdebug.h, somk.dbg, som3.0 9/4/96 13:45:22 [12/24/96 07:41:37] */
  2.  
  3. /*
  4.  * 96F8647, 96F8648, 96F8850 (C) Copyright IBM Corp. 1994
  5.  * All Rights Reserved
  6.  * Licensed Materials - Property of IBM
  7.  *
  8.  */
  9.  
  10. /*
  11.  *      SOMDEBUG.H
  12.  *      SOM Kernel Debugging Hooks
  13.  *
  14.  *      We assume a debugger that operates in its own process and
  15.  *      has access to the memory in another process that is being
  16.  *      debugged.
  17.  *
  18.  *      The SOM Kernel Debugging Hook functions described here use
  19.  *      a debugger-supplied function (prototyped below as SOMTD_SOMPeek)
  20.  *      to reach into the process being debugged and compute various
  21.  *      results useful to debuggers.  No side-effect are experienced
  22.  *      in the debugged process as a result of invoking these functions.
  23.  *
  24.  *      To install the debugger-supplied SOMTD_SOMPeek function,
  25.  *      simply place its address in the SOMPeek external variable.
  26.  *
  27.  *      All addresses returned from the SOM Kernel Debugging Hook
  28.  *      functions refer to memory in the debugged process, with
  29.  *      ONE exception.  The sequence returned from
  30.  *      somDbgGetInstanceDataOffsets has its buffer allocated in
  31.  *      the debugger's process (to avoid side-effect in the debugged
  32.  *      process).  The space for this buffer is obtained via "malloc".
  33.  *      The debugger must free the buffer when finished with it, using
  34.  *      code similar to the following:
  35.  *
  36.  *          SOMClass_somOffsets result;
  37.  *          result = somDbgGetInstanceDataOffsets (cls);
  38.  *          ...
  39.  *          if (result._length)
  40.  *              free (result._buffer);
  41.  */
  42.  
  43. #ifndef somdebug_h
  44. #define somdebug_h
  45.  
  46. #include <som.h>
  47.  
  48. /*
  49.  * somDbgIdSequence type -- used as a return type for some Dbg functions.
  50.  */
  51. typedef struct {
  52.     long   _maximum;
  53.     long   _length;
  54.     char **_buffer;
  55. } somDbgIdSequence;
  56.  
  57. /*
  58.  *      The following debugger-supplied function extracts memory
  59.  *      from the debugged process begining at the address specified
  60.  *      by "startAddr" in the debugged process and copies it into the
  61.  *      address specified by "targetAddr" in the current process until
  62.  *      the number of bytes specified by length have been transferred.
  63.  *      If everything completes successfully the function must return
  64.  *      the value TRUE, otherwise FALSE must be returned.
  65.  */
  66. typedef long SOMLINK SOMTD_SOMPeek (void *startAddr, long length,
  67.                                     void *targetAddr);
  68. SOMEXTERN SOMTD_SOMPeek *SOMPeek;
  69.  
  70. /*
  71.  * somDbg functions
  72.  */
  73.  
  74. SOMEXTERN void * SOMLINK
  75.     somDbgDataResolve(SOMObject *obj, somDToken dtoken);
  76.  
  77. SOMEXTERN somDbgIdSequence SOMLINK
  78.     somDbgGetAllMethodDescriptors(SOMClass *cls);
  79.  
  80. SOMEXTERN SOMClass * SOMLINK
  81.     somDbgGetClass (SOMObject *obj);
  82.  
  83. SOMEXTERN string SOMLINK
  84.     somDbgGetClassName (SOMObject *obj);
  85.  
  86. SOMEXTERN SOMClass_somOffsets SOMLINK
  87.     somDbgGetInstanceDataOffsets(SOMClass *somSelf);
  88.  
  89. SOMEXTERN long SOMLINK
  90.     somDbgGetInstanceSize(SOMClass *cls);
  91.  
  92. SOMEXTERN somDbgIdSequence SOMLINK
  93.     somDbgGetIntroducedMethodDescriptors(SOMClass *cls);
  94.  
  95. SOMEXTERN string SOMLINK
  96.     somDbgGetName (SOMClass *cls);
  97.  
  98. SOMEXTERN SOMClassSequence SOMLINK
  99.     somDbgGetParents(SOMClass *cls);
  100.  
  101. SOMEXTERN void SOMLINK
  102.     somDbgGetVersionNumbers(SOMClass *cls, long *major, long *minor);
  103.  
  104. SOMEXTERN boolean SOMLINK
  105.     somDbgIsObj(SOMObject *obj);
  106.  
  107. SOMEXTERN unsigned long SOMLINK
  108.     somDbgProtectedDataOffset(SOMClass *cls);
  109.  
  110. SOMEXTERN somMethodProc * SOMLINK
  111.     somDbgResolveMethod (SOMObject *obj, somMToken mtoken);
  112.  
  113.  
  114. #endif /* somdebug_h */
  115.