Debugging.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. {
  2. File: Debugging.p
  3. Contains: Macros to handle exceptions and assertions.
  4. Version: Technology: Carbon
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1989-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit Debugging;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,Files;
  92. {
  93. ______________________________________________________________________________________
  94. This file defines standard exception handling and assertion macros for
  95. system-level programming in C. Originally used in QuickDraw GX, and heavily
  96. modified since, these macros are used extensively throughout Mac OS system
  97. software. Now *you* can look and feel like a system software engineer.
  98. To activate debugger breaks, #define DEBUG to 1 (one) before including this file.
  99. Five further levels of debugging are available, selected by #defining one
  100. of the following conditionals to 1 after DEBUG is defined to 1.
  101. DEBUG_INTERNAL the default; includes file and line number information
  102. DEBUG_EXTERNAL used for code which must ship to developers outside
  103. your organization; no file or line number information is
  104. included in asserts
  105. DEBUG_BREAK_ONLY where an assertion would normally be sent to the debugger,
  106. send an empty string instead.
  107. PRODUCTION used for shipping code; no debugger breaks are emitted
  108. PERFORMANCE same as PRODUCTION
  109. #defining DEBUG to 0 is equivalent to #defining PRODUCTION 1 when DEBUG is 1.
  110. (No code for debugger breaks is emitted in either case.)
  111. Of the multitude of macros, the preferred ones are:
  112. debug_string(c-string)
  113. If debugging is on, c-string is printed in the debugger.
  114. In production builds, debug_string() does nothing.
  115. check(expression)
  116. check_noerr(error)
  117. If (expression) evaluates to false, break into the debugger.
  118. In production builds, check() does nothing.
  119. Code inside check() statements is not compiled into production builds.
  120. require(expression, label)
  121. require_noerr(expression, label)
  122. If (expression) evaluates to false, announce this fact via the
  123. debugger and then goto label. In production builds, does not call
  124. the debugger but still goes to label if expression is false.
  125. require_action(expression, label, action)
  126. require_noerr_action(expression, label, action)
  127. Same as require, but executes (action) before jumping to label.
  128. check_string(expression, c-string)
  129. require_string(expression, label, c-string)
  130. require_noerr_string(expression, label, c-string)
  131. If expression evaluates to false, print string and then proceed as in
  132. a normal check/require statement
  133. verify(expression)
  134. verify_noerr(error)
  135. If debugging is on, verify is the same as check(expression).
  136. If debugging is off, verify still evaluates (expression)
  137. but ignores the result. Code inside verify() statements
  138. is executed in both production and debug builds.
  139. Common usage:
  140. // my pixmap is not purgeable, so locking it should never fail
  141. verify( LockPixels(myPixMap) );
  142. verify_noerr( DisposeThread(myThread, &threadResult, true) );
  143. ______________________________________________________________________________________
  144. }
  145. {
  146. ______________________________________________________________________________________
  147. Before including this file, #define kComponentSignatureString to a C-string
  148. containing the name of your client.
  149. example: #define kComponentSignatureString "SurfWriter"
  150. ______________________________________________________________________________________
  151. }
  152. {
  153. ______________________________________________________________________________________
  154. DEBUGASSERTMSG - all error reporting is routed through this macro, which calls the
  155. system routine DebugAssert(). If you wish to use your own assertion/debugger break
  156. routine, you can override DEBUGASSERTMSG by defining it before including this file.
  157. ______________________________________________________________________________________
  158. }
  159. {$ALIGN MAC68K}
  160. {
  161. * DebugAssert()
  162. *
  163. * Availability:
  164. * Non-Carbon CFM: in DebugLib 1.0 and later
  165. * CarbonLib: in CarbonLib 1.0 and later
  166. * Mac OS X: in version 10.0 and later
  167. }
  168. procedure DebugAssert(componentSignature: OSType; options: UInt32; assertionString: ConstCStringPtr; exceptionString: ConstCStringPtr; errorString: ConstCStringPtr; fileName: ConstCStringPtr; lineNumber: SInt32; value: UnivPtr); external name '_DebugAssert';
  169. {
  170. kBlessedBusErrorBait is an address that will never be mapped
  171. by Mac OS 8 or 9. It is close to the middle of the 64K range from
  172. 0x68F10000 to 0x68F1FFFF that is unmapped and cannot be accessed
  173. without causing an exception. Thus, it's a good value to use for
  174. filling uninitialized pointers, etc.
  175. }
  176. const
  177. kBlessedBusErrorBait = $68F168F1;
  178. { TaskLevel masks }
  179. k68kInterruptLevelMask = $00000007;
  180. kInVBLTaskMask = $00000010;
  181. kInDeferredTaskMask = $00000020;
  182. kInSecondaryIntHandlerMask = $00000040;
  183. kInNestedInterruptMask = $00000080;
  184. kComponentDebugOption = 0; { optionSelectorNum to turn breaks for component on/off }
  185. kGetDebugOption = 1; { get current debug option setting }
  186. kSetDebugOption = 2; { set debug option }
  187. {
  188. DebugComponentCallback
  189. DebugComponentCallback is the callback into a component that registers with DebugLib.
  190. It is called to get the debug option setting, or to turn a debug option on or off.
  191. Inputs:
  192. optionSelectorNum The component debug option to set
  193. command The command:
  194. kGetDebugOption - get current debug option setting
  195. kSetDebugOption - set debug option
  196. Outputs:
  197. optionSetting The current setting if kGetDebugOption;
  198. the new debug option if kSetDebugOption
  199. }
  200. type
  201. {$ifc TYPED_FUNCTION_POINTERS}
  202. DebugComponentCallbackProcPtr = procedure(optionSelectorNum: SInt32; command: UInt32; var optionSetting: boolean);
  203. {$elsec}
  204. DebugComponentCallbackProcPtr = ProcPtr;
  205. {$endc}
  206. {$ifc OPAQUE_UPP_TYPES}
  207. DebugComponentCallbackUPP = ^SInt32; { an opaque UPP }
  208. {$elsec}
  209. DebugComponentCallbackUPP = UniversalProcPtr;
  210. {$endc}
  211. {
  212. TaskLevel
  213. TaskLevel returns 0 if we're (probably) running at non-interrupt time.
  214. There's no way to make this perfect, but this is as close as we can get.
  215. If TaskLevel doesn't return 0, then the following masks can be used to learn more:
  216. k68kInterruptLevelMask = 0x00000007
  217. kInVBLTaskMask = 0x00000010
  218. kInDeferredTaskMask = 0x00000020
  219. kInSecondaryIntHandlerMask = 0x00000040
  220. kInNestedInterruptMask = 0x00000080
  221. }
  222. {
  223. * TaskLevel()
  224. *
  225. * Availability:
  226. * Non-Carbon CFM: in DebugLib 1.0 and later
  227. * CarbonLib: in CarbonLib 1.0 and later
  228. * Mac OS X: in version 10.0 and later
  229. }
  230. function TaskLevel: UInt32; external name '_TaskLevel';
  231. {
  232. NewDebugComponent
  233. NewDebugComponent registers a component with DebugLib.
  234. Inputs:
  235. componentSignature The unique signature of component
  236. componentName The displayable string naming the component
  237. componentCallback The callback into component for working with options
  238. Result:
  239. noErr no error
  240. memFullErr could not allocate memory
  241. debuggingExecutionContextErr routine cannot be called at this time
  242. debuggingDuplicateSignatureErr componentSignature already registered
  243. debuggingInvalidNameErr componentName is invalid (NULL)
  244. }
  245. {
  246. * NewDebugComponent()
  247. *
  248. * Availability:
  249. * Non-Carbon CFM: in DebugLib 1.0 and later
  250. * CarbonLib: in CarbonLib 1.0 and later
  251. * Mac OS X: in version 10.0 and later
  252. }
  253. function NewDebugComponent(componentSignature: OSType; const (*var*) componentName: Str255; componentCallback: DebugComponentCallbackUPP): OSStatus; external name '_NewDebugComponent';
  254. {
  255. NewDebugOption
  256. NewDebugOption registers a debug option with DebugLib.
  257. Inputs:
  258. componentSignature The signature of component to register a debug option for
  259. optionSelectorNum The selector number of this debug option
  260. optionName The displayable string naming this debug option
  261. Result:
  262. noErr no error
  263. memFullErr could not allocate memory
  264. debuggingExecutionContextErr called at interrupt time
  265. debuggingDuplicateOptionErr optionSelectorNum already registered
  266. debuggingInvalidSignatureErr componentSignature not registered
  267. debuggingInvalidNameErr optionName is invalid (NULL)
  268. debuggingNoCallbackErr debugging component has no callback
  269. }
  270. {
  271. * NewDebugOption()
  272. *
  273. * Availability:
  274. * Non-Carbon CFM: in DebugLib 1.0 and later
  275. * CarbonLib: in CarbonLib 1.0 and later
  276. * Mac OS X: in version 10.0 and later
  277. }
  278. function NewDebugOption(componentSignature: OSType; optionSelectorNum: SInt32; const (*var*) optionName: Str255): OSStatus; external name '_NewDebugOption';
  279. {
  280. DisposeDebugComponent
  281. DisposeDebugComponent removes a component registration and all related debug options from DebugLib.
  282. Input:
  283. componentSignature The unique signature of a component
  284. Result:
  285. noErr no error
  286. debuggingExecutionContextErr called at interrupt time
  287. debuggingInvalidSignatureErr componentSignature not registered
  288. }
  289. {
  290. * DisposeDebugComponent()
  291. *
  292. * Availability:
  293. * Non-Carbon CFM: in DebugLib 1.0 and later
  294. * CarbonLib: in CarbonLib 1.0 and later
  295. * Mac OS X: in version 10.0 and later
  296. }
  297. function DisposeDebugComponent(componentSignature: OSType): OSStatus; external name '_DisposeDebugComponent';
  298. {
  299. GetDebugComponentInfo
  300. GetDebugComponentInfo returns a component registered with DebugLib.
  301. Inputs:
  302. index The index into the list of registered components (1-based)
  303. Outputs:
  304. componentSignature The unique signature of a component
  305. componentName The displayable string naming a component
  306. Result:
  307. noErr no error
  308. debuggingNoMatchErr debugging component not found at this index
  309. }
  310. {
  311. * GetDebugComponentInfo()
  312. *
  313. * Availability:
  314. * Non-Carbon CFM: in DebugLib 1.0 and later
  315. * CarbonLib: in CarbonLib 1.0 and later
  316. * Mac OS X: in version 10.0 and later
  317. }
  318. function GetDebugComponentInfo(index: UInt32; var componentSignature: OSType; var componentName: Str255): OSStatus; external name '_GetDebugComponentInfo';
  319. {
  320. GetDebugOptionInfo
  321. GetDebugOptionInfo returns a debug option registered with DebugLib.
  322. Inputs:
  323. index The index into the list of registered debug options (0-based);
  324. 0 = kComponentDebugOption
  325. componentSignature The unique signature of a component
  326. Outputs:
  327. optionSelectorNum The selector number of this debug option
  328. optionName The displayable string naming this debug option
  329. optionSetting The current debug option setting
  330. Result:
  331. noErr no error
  332. debuggingInvalidSignatureErr componentSignature not registered
  333. debuggingNoMatchErr option not found at this index
  334. }
  335. {
  336. * GetDebugOptionInfo()
  337. *
  338. * Availability:
  339. * Non-Carbon CFM: in DebugLib 1.0 and later
  340. * CarbonLib: in CarbonLib 1.0 and later
  341. * Mac OS X: in version 10.0 and later
  342. }
  343. function GetDebugOptionInfo(index: UInt32; componentSignature: OSType; var optionSelectorNum: SInt32; var optionName: Str255; var optionSetting: boolean): OSStatus; external name '_GetDebugOptionInfo';
  344. {
  345. SetDebugOptionValue
  346. SetDebugOptionValue sets a debug option registered with DebugLib.
  347. Inputs:
  348. componentSignature The unique signature of a component
  349. optionSelectorNum The selector number of this debug option
  350. newOptionSetting The new debug option setting
  351. Result:
  352. noErr no error
  353. debuggingInvalidSignatureErr componentSignature not registered
  354. debuggingInvalidOptionErr optionSelectorNum is not registered
  355. }
  356. {
  357. * SetDebugOptionValue()
  358. *
  359. * Availability:
  360. * Non-Carbon CFM: in DebugLib 1.0 and later
  361. * CarbonLib: in CarbonLib 1.0 and later
  362. * Mac OS X: in version 10.0 and later
  363. }
  364. function SetDebugOptionValue(componentSignature: OSType; optionSelectorNum: SInt32; newOptionSetting: boolean): OSStatus; external name '_SetDebugOptionValue';
  365. {
  366. DebugAssertOutputHandler
  367. DebugAssertOutputHandler is the callback that registers with DebugLib to handle the
  368. output from DebugAssert.
  369. Inputs:
  370. "componentSignature" through "value" are the raw values passed to DebugAssert
  371. when an exception occurs.
  372. outputMsg is the string DebugAssert build which would normally be passed to
  373. DebugStr if a DebugAssertOutputHandler isn't installed.
  374. }
  375. type
  376. {$ifc TYPED_FUNCTION_POINTERS}
  377. DebugAssertOutputHandlerProcPtr = procedure(componentSignature: OSType; options: UInt32; assertionString: ConstCStringPtr; exceptionString: ConstCStringPtr; errorString: ConstCStringPtr; fileName: ConstCStringPtr; lineNumber: SInt32; value: UnivPtr; outputMsg: Str255);
  378. {$elsec}
  379. DebugAssertOutputHandlerProcPtr = ProcPtr;
  380. {$endc}
  381. {$ifc OPAQUE_UPP_TYPES}
  382. DebugAssertOutputHandlerUPP = ^SInt32; { an opaque UPP }
  383. {$elsec}
  384. DebugAssertOutputHandlerUPP = UniversalProcPtr;
  385. {$endc}
  386. {
  387. InstallDebugAssertOutputHandler
  388. InstallDebugAssertOutputHandler installs a DebugAssertOutputHandler which DebugAssert calls
  389. instead of DebugStr.
  390. Inputs:
  391. handler the DebugAssertOutputHandler to install or NULL to switch back to
  392. the default handler (DebugStr).
  393. }
  394. {
  395. * InstallDebugAssertOutputHandler()
  396. *
  397. * Availability:
  398. * Non-Carbon CFM: in DebugLib 1.0 and later
  399. * CarbonLib: in CarbonLib 1.0 and later
  400. * Mac OS X: in version 10.0 and later
  401. }
  402. procedure InstallDebugAssertOutputHandler(handler: DebugAssertOutputHandlerUPP); external name '_InstallDebugAssertOutputHandler';
  403. {
  404. dprintf() takes a variable argument list and 'prints' that to the debugging output
  405. handler. Calling dprintf() from anything but C or C++ is tricky.
  406. }
  407. {$ifc CALL_NOT_IN_CARBON}
  408. {
  409. * dprintf()
  410. *
  411. * Availability:
  412. * Non-Carbon CFM: in DebugLib 1.1 and later
  413. * CarbonLib: not available
  414. * Mac OS X: not available
  415. }
  416. procedure dprintf(format: ConstCStringPtr; ...); external name '_dprintf';
  417. { vdprintf() takes a va_args list and 'prints' that to the debugging output handler. }
  418. {
  419. * vdprintf()
  420. *
  421. * Availability:
  422. * Non-Carbon CFM: in DebugLib 1.1 and later
  423. * CarbonLib: not available
  424. * Mac OS X: not available
  425. }
  426. procedure vdprintf(format: ConstCStringPtr; va_args_list: CStringPtr); external name '_vdprintf';
  427. {$endc} {CALL_NOT_IN_CARBON}
  428. const
  429. uppDebugComponentCallbackProcInfo = $00000FC0;
  430. uppDebugAssertOutputHandlerProcInfo = $00FFFFC0;
  431. {
  432. * NewDebugComponentCallbackUPP()
  433. *
  434. * Availability:
  435. * Non-Carbon CFM: available as macro/inline
  436. * CarbonLib: in CarbonLib 1.0 and later
  437. * Mac OS X: in version 10.0 and later
  438. }
  439. function NewDebugComponentCallbackUPP(userRoutine: DebugComponentCallbackProcPtr): DebugComponentCallbackUPP; external name '_NewDebugComponentCallbackUPP'; { old name was NewDebugComponentCallbackProc }
  440. {
  441. * NewDebugAssertOutputHandlerUPP()
  442. *
  443. * Availability:
  444. * Non-Carbon CFM: available as macro/inline
  445. * CarbonLib: in CarbonLib 1.0 and later
  446. * Mac OS X: in version 10.0 and later
  447. }
  448. function NewDebugAssertOutputHandlerUPP(userRoutine: DebugAssertOutputHandlerProcPtr): DebugAssertOutputHandlerUPP; external name '_NewDebugAssertOutputHandlerUPP'; { old name was NewDebugAssertOutputHandlerProc }
  449. {
  450. * DisposeDebugComponentCallbackUPP()
  451. *
  452. * Availability:
  453. * Non-Carbon CFM: available as macro/inline
  454. * CarbonLib: in CarbonLib 1.0 and later
  455. * Mac OS X: in version 10.0 and later
  456. }
  457. procedure DisposeDebugComponentCallbackUPP(userUPP: DebugComponentCallbackUPP); external name '_DisposeDebugComponentCallbackUPP';
  458. {
  459. * DisposeDebugAssertOutputHandlerUPP()
  460. *
  461. * Availability:
  462. * Non-Carbon CFM: available as macro/inline
  463. * CarbonLib: in CarbonLib 1.0 and later
  464. * Mac OS X: in version 10.0 and later
  465. }
  466. procedure DisposeDebugAssertOutputHandlerUPP(userUPP: DebugAssertOutputHandlerUPP); external name '_DisposeDebugAssertOutputHandlerUPP';
  467. {
  468. * InvokeDebugComponentCallbackUPP()
  469. *
  470. * Availability:
  471. * Non-Carbon CFM: available as macro/inline
  472. * CarbonLib: in CarbonLib 1.0 and later
  473. * Mac OS X: in version 10.0 and later
  474. }
  475. procedure InvokeDebugComponentCallbackUPP(optionSelectorNum: SInt32; command: UInt32; var optionSetting: boolean; userRoutine: DebugComponentCallbackUPP); external name '_InvokeDebugComponentCallbackUPP'; { old name was CallDebugComponentCallbackProc }
  476. {
  477. * InvokeDebugAssertOutputHandlerUPP()
  478. *
  479. * Availability:
  480. * Non-Carbon CFM: available as macro/inline
  481. * CarbonLib: in CarbonLib 1.0 and later
  482. * Mac OS X: in version 10.0 and later
  483. }
  484. procedure InvokeDebugAssertOutputHandlerUPP(componentSignature: OSType; options: UInt32; assertionString: ConstCStringPtr; exceptionString: ConstCStringPtr; errorString: ConstCStringPtr; fileName: ConstCStringPtr; lineNumber: SInt32; value: UnivPtr; const (*var*) outputMsg: Str255; userRoutine: DebugAssertOutputHandlerUPP); external name '_InvokeDebugAssertOutputHandlerUPP'; { old name was CallDebugAssertOutputHandlerProc }
  485. {
  486. ______________________________________________________________________________________
  487. Tech Q&A PLAT-30 says to check bit 5 of the byte at 0xbff to
  488. determine whether MacsBug ( or any other low level debugger )
  489. is installed; I also check that MacJmp ( which points to the
  490. entry point for the debugger ) is not nil and not -1.
  491. MacJmpFlag:
  492. Bit 5 should be set to indicate the debugger is installed.
  493. Bit 6 should be set to indicate the debugger is initialized.
  494. Bit 7 should be clear to indicate that the debugger is NOT busy
  495. Dr. MacsBug says to also check that the byte at 0xBFF isn't 0xFF.
  496. ______________________________________________________________________________________
  497. }
  498. {$ifc CALL_NOT_IN_CARBON}
  499. {$endc} {CALL_NOT_IN_CARBON}
  500. { no-op asserts for production code }
  501. {______________________________________________________________________________________}
  502. {______________________________________________________________________________________}
  503. {______________________________________________________________________________________}
  504. {______________________________________________________________________________________}
  505. {______________________________________________________________________________________}
  506. {______________________________________________________________________________________}
  507. {______________________________________________________________________________________}
  508. {______________________________________________________________________________________}
  509. {______________________________________________________________________________________}
  510. {______________________________________________________________________________________}
  511. {______________________________________________________________________________________}
  512. {______________________________________________________________________________________}
  513. {______________________________________________________________________________________}
  514. {______________________________________________________________________________________}
  515. {______________________________________________________________________________________}
  516. {______________________________________________________________________________________}
  517. {______________________________________________________________________________________}
  518. {$ALIGN MAC68K}
  519. end.