home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Interfaces / CIncludes / UDebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-25  |  6.3 KB  |  145 lines  |  [TEXT/MPS ]

  1. /*[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]*/
  2. /* UDebug.p */
  3. /* Copyright © 1985-1990 by Apple Computer, Inc.  All rights reserved. */
  4. #ifndef  __UDebug__
  5. #define __UDebug__  0
  6. #endif
  7. #if  ! __UDebug__
  8. #define __UDebug__  1
  9.  
  10.         /* • Auto-Include the requirements for this unit's interface. */
  11. #ifndef  __UMacAppUtilities__
  12. #include "UMacAppUtilities.h"
  13. #endif
  14.  
  15. #ifndef qMPW31
  16. #define qMPW31 0
  17. #endif
  18.         
  19. const short kMaxFlags            = 20;                    /* maximum flags that can be remembered by
  20.                                                          the debugger */
  21. const short kMaxSyms            = 20;
  22.    /* maximum symbols remembered by the debugger
  23.                                                          */
  24.  
  25. typedef enum {forceOn, forceOff, forceUnchanged} DebugForceOptions;
  26.             /* Used with DebugForceOptions procedure. */
  27.  
  28. #if qMPW31
  29. typedef DisAsmStr80  Str255;
  30. #endif
  31.             
  32. extern pascal Boolean gMastReport;                        /* When TRUE, report changes in # master
  33.                                                          pointers. */
  34. extern pascal long gMaxStackDepth;                        /* Maximum stack space used to date in the
  35.                                                          program. This is computed every
  36.                                                          %_BP/%_EP/%_EX. */
  37. extern pascal Str255 gReportInfo;                        /* If gReportNext and gReportInfo <>'' then
  38.                                                          display the text of gReportInfo on next
  39.                                                          %_BP or %_EP, then clear the buffer. */
  40. extern pascal Boolean gReportNext;
  41.    /* If set to TRUE, report pending information
  42.                                                          (e.g., gReportInfo) at the very next %_BP
  43.                                                          or %_EP. */
  44. extern pascal Boolean gReportTime;
  45.    /* if TRUE, report TickCount during tracing */
  46. extern pascal Boolean gSingleStep;                        /* if TRUE, break into debugger at next
  47.                                                          opportunity */
  48. extern pascal Boolean gTracing;                            /* TRUE when the debugger is tracing. Set
  49.                                                          this using TrcEnable function. */
  50.  
  51. extern pascal Boolean DebugCanReadLn(void);
  52.         /* Returns True if you can ReadLn to the user. This in turn is true when there is a debu
  53.            g view
  54.         (pDebugView), that view can currently write to its window, and this unit is initialized. */
  55.  
  56. extern pascal Boolean DebugCanWriteLn(void);
  57.         /* Returns true if you can WriteLn to the user in the debug window. This is true if there
  58.         exists a debug view and this unit is initialized. */
  59.  
  60. extern pascal void GetCallersMethodName(StringPtr s);
  61.         /* Return the name of the calling method in s. */
  62.  
  63. extern pascal void GetMethodName(long ppc, StringPtr s);
  64.         /* Returns in s the name of the method or procedure into which address ppc points. Calls
  65.         GetProcName to do the work. */
  66.  
  67. extern pascal void GetProcName(long ppc, StringPtr className, StringPtr procName);
  68.         /* Returns in procName the name of the method, procedure, or function into which address ppc
  69.         points. If it is a method, the method's class is returned in className. If not a method,
  70.  
  71.         className is set to ''. */
  72.  
  73. extern pascal void ShowMemory(long startAddress, long numBytes);
  74.         /* Dump memory to Transcript from startaddress for numBytes */
  75.  
  76. extern pascal void IDUDebug(void);
  77.         /* Prints in the debug window the compile date and time of this unit. */
  78.  
  79. extern pascal Boolean TrcEnable(Boolean okToTrace);
  80.         /* When a WriteLn call is made, the captureregistered through this function is called wi
  81.            th the
  82.         sequence */
  83.  
  84. #if  qPerform
  85.  
  86. extern pascal Boolean DebugPerfMonitor(Boolean turnOn);
  87.         /* When a WriteLn call is made, the captureregistered through this function is called wi
  88.            th the
  89.         sequence */
  90. #endif
  91. #if  qDebug
  92.  
  93. extern pascal Ptr DebugCapture(Ptr captureProc);
  94.         /* When a WriteLn call is made, the captureproc registered through this function is called
  95.         with the sequence:
  96.         captureProc(textBuf: Ptr; byteCount: INTEGER);
  97.         The return value is the address of the previous captureProc. The debug view's AddText method
  98.         is called immediately after the captureProc.*/
  99.  
  100. extern pascal OSErr DebugRedirect(short vRefnum, StringPtr fileName);
  101.         /* Returns number of characters per line in current transcript window. */
  102.  
  103. extern pascal short DebugTranscriptWidth(void);
  104.         /* Returns number of characters per line in current transcript window. */
  105.  
  106. extern pascal void EnterMacAppDebugger(void);
  107.         /* Invokes the debugger. Called by ProgramBreak in UFailure. */
  108.  
  109. extern pascal void DebugEndForce(void);
  110.         /* Calls the EndForce method of the debug view (see UTranscriptView.) */
  111.  
  112. extern pascal void DebugFlag(BooleanPtr flagAddr, short flagChar, Ptr theActionProc, StringPtr 
  113.    flagDesc);
  114.         /* Register a BOOLEAN flag for the X debugger command; flagAddr should be the address of the
  115.         flag; theActionshould be a procPtr for a to be called to change the flag (optional - may be
  116.         NIL).flagChar should be the character to use in the debugger to toggle the flag; desc
  117.         should be a short description of the flag.No checking is done for duplicate flagChars. */
  118.  
  119. extern pascal void DebugForceOutput(DebugForceOptions DebugToWindow, DebugForceOptions DebugToFile);
  120.         /* Calls the ForceOutput method of the debug view (see UTranscriptView.) */
  121.  
  122. extern pascal void DebugGlobalHandle(Ptr globAddr, Ptr theActionProc, StringPtr *globSym);
  123.         /* Register a symbol name of a global variable that contains a handle; case does not matter.
  124.         The global variable should contain a Handle.The Action is a Function to be called to derive
  125.         the handle if necessary. Symbolic handles registered in this way may be entered in response
  126.         to the F and I commands of the debugger. */
  127.  
  128. extern pascal void DebugShowTranscriptWindow(void);
  129.         /* Opens the debug transcript window. */
  130.  
  131. extern pascal void DebugTerminate(void);
  132.         /* Called to initialize the UDebug unit. */
  133.  
  134. extern pascal void InitUDebug(Handle segTable, Handle nonRes, Ptr enterProc, Ptr inspectProc, Ptr 
  135.    symbolProc);
  136.  
  137. extern pascal void InitUDebugAfterIApplication(void);
  138.         /* Call this once at the end of IApplication to finish initialization of the debugger.
  139.         Installs the debug window in the event handler chain and installs a print handler in the
  140.         debug view. */
  141.  
  142. #endif
  143. #endif
  144.  
  145.