home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / somdebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-24  |  3.9 KB  |  130 lines

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