Discipline is an extension to MacsBug (This version works with
[MacsBug 6.2][1]) that provides the ability to set automatic parameter
checks on calls to ROM routines. (e.g. you could set a trap to throw
an error if you try to create a window larger than a certain value.)

> ## Discipline
>
> * * *
>
> |  Discipline is a set of routines that a debugger calls to test the
> validity of parameters passed to a User Interface Toolbox or
> operating system routine and to test the validity of parameters
> passed back to your application by that routine. This chapter
> describes how you install Discipline, how you determine which tests
> Discipline should use to test parameters, and how you work with
> Discipline during application development.
>
>  Discipline is not a stand-alone tool; it must always be used with a
> resident debugger. This chapter assumes the the debugger is MacsBug.
>
>  For additional information about the way Discipline interfaces with
> MacsBug, see Appendix E, "MacsBug Internals and Discipline
> Interface."
> ---|---
>
> ## How Discipline Works
>
> * * *
>
> |  If Discipline is installed and your application makes a system
> call, MacsBug passes the call to Discipline instead of passing the
> call to the trap dispatcher. Discipline is responsible for
> performing two series of tests: it runs the first series before the
> call executes and the second series after the call executes.
>
>  Discipline selects the tests it's going to use depending on the
> call being tested and on the configuration file you selected when
> you installed Discipline. Thus Discipline might test the order in
> which you have specified the parameters for a call, test the
> validity of pointers, or check valid ranges for some or all of the
> parameters.
>
>  If the system call fails its initial (pre-execution) test, MacsBug
> saves the results in a history buffer and drops into MacsBug where
> you can examine the information it returns. If the call passes its
> initial test and you have set no actions on that trap (ATB, ATHC,
> ATSS), MacsBug hands it off to the trap dispatcher, which finds the
> location of the call in ROM or RAM and executes the call.
>
>  After the call executes, Discipline again tests the values returned
> by the call. If it finds that the values are invalid or less than
> optimal, it drops into MacsBug and displays a diagnostic message. If
> the returned values pass Discipline's tests, the next instruction is
> executed.
> ---|---
>
> ## Installing Discipline
>
> * * *
>
> |  You can install Discipline either as an INIT or as an
> application, depending on your memory requirements and on whether
> you plan to run it in a single-application environment (system
> software version earlier than 7.0 with MultiFinder turned off) or a
> multiple-application environment (system software 7.0, or system
> software version 5.0 or 6.0 with MultiFinder turned on).
>
>
>
> ### Installing Discipline as an INIT File
>
>
>
>
> * * *
>
> If you are working in a single-application environment, you should
> install Discipline as an INIT file. In this case, Discipline remains
> installed until you shut down your Macintosh. To install Discipline,
> follow these steps:
>
>   1. Insert and open the Discipline disk.
>   2. Move the Discipline file into your System Folder.
>   3. Open the Configuration folder on the Discipline disk.
>   4. Open either the Lenient or the Strict configuration folder.
> Select the Discipline Startup file and move it into your System
> Folder.
>
>  You indicate which test you want Discipline to apply by selecting
> one of the two configuration files: Lenient or Strict. Each of these
> files contains different tests that Discipline uses to test the
> parameters of each system call. The difference between these
> configurations is implied by their names: it will be easier for the
> parameters you supply to satisfy the lenient tests than to satisfy
> the strict tests.
>   5. Restart your Macintosh.
>
The message shown in Figure 6-1 is displayed to let you know that the
installation was successful.
>  |  Figure 6-1 |  Discipline installation message
> ---|---
> DISCIPLINE needs a minute to load the Startup file.
> ---
>
> You can prevent Discipline from loading when you start up your
> machine either by taking Discipline out of your System Folder and
> restarting, or by holding down the Option key while your Macintosh
> is starting up.
>
>  Discipline is turned off initially. It does not check trap calls
> until you turn it on. The command syntax you use to turn Discipline
> on and off and to select Discipline options depends on the debugger
> with which Discipline is running. The section "Using Discipline
> During Application Development" in this chapter describes how you
> use Discipline from MacsBug.
>
>
>
> ### Installing Discipline as an Application
>
>
>
>
> * * *
>
> If you are working in a multiple-application environment, you will
> probably want to install Discipline as an application. In this case,
> Discipline remains installed until you turn it off from the debugger
> or press Command-Q to quit the Discipline application.
>
>  To install Discipline as an application, follow these steps:
>
>   1. Insert and open the Discipline disk.
>   2. Move the Discipline file into any folder you wish. It does not
> have to be the System Folder.
>   3. Open the Configuration folder on the Discipline disk.
>   4. Open either the Lenient or Strict configuration folder and move
> the Discipline Startup file into the folder containing Discipline.
>
>  You indicate which tests you want Discipline to apply by selecting
> one of two configuration files: Lenient or Strict. Each of these
> files contains different tests that Discipline uses to test the
> parameters of each system call. The difference between these
> configurations is implied by their names: it will be easier for the
> parameters you supply to satisfy the lenient tests than to satisfy
> the strict tests.
>   5. To install and launch Discipline, hold the Option and Command
> keys down while double-clicking the Discipline file.
>

>
> When Discipline is installed, the message shown in Figure 6-1 is
> displayed. When Discipline is launched, its icon will be displayed
> in the space where the active application's icon is normally
> displayed, and the rest of the menu bar will be completely blank;
> even the Apple menu will be gone. This is just as it should be. You
> can get back to Finder by clicking on the Discipline icon or on the
> desktop.
>
>  At this point, you can see Discipline listed as an active
> application in the Apple menu. Also, Discipline is turned on and
> your are very likely to find yourself in MacsBug or the resident
> debugger because Discipline seldom approves of the way in which
> Finder accesses system calls. Thsi would be a good time to either
> turn Discipline off or to leave it on only for applications.
>
>  If MacsBug is the resident debugger, you can turn Discipline off by
> entering
>
>  DSC OFF
>
>  on the command line or by typing Command-Q. When you are ready to
> use Discipline to test an application, you can turn it back on.
>
>  To leave Discipline on but arrange things so Discipline doesn't
> have to worry about the Finder's manners, enter
>
>  DSCA
>
>  from MacsBug.
>
>  If you are working in a multiple-application environment, you can
> install Discipline either as an INIT file or as an application. In
> this case, it is your need for memory that might dictate which way
> you install it. If you install it as an INIT file, Discipline will
> take up space in the system heap until you shutdown your computer.
> If you install it as an application, Discipline will only take up
> space in the system heap when it is turned on.

? excerpt from MacsBug Reference and Debugging Guide (for MacsBug
6.2), Chapter 6, pp.155-158


Version number is unclear. The Discipline extension is labeled version
2.0.1, but is also referred to as "MacsBug and Discipline 1.0.2."

Download contains a folder copy of Discipline and example files.

Compatibility
Architecture: 68k

Requires MacsBug 6.2

> |
>
>
> ### Restrictions on Discipline
>
> * * *
>
> You must observe the following restrictions when using Discipline.
>
>  If you are using MacsBug,
>
>
>   * A command line containing a DSC command cannot contain macros.
>   * You cannot log MacsBug output if DSC is on.
>   * If Discipline crashes, you must turn it off using the DSC OFF or
> DSCA OFF command before you use the ES (Exit to Shell) command.
>
If you are using any debugger (including MacsBug) and Finder is the
current application, do not turn Discipline on or you will be
inundated with complaints. This does not mean that there is anything
wrong with Finder, and it does not mean that there is anything wrong
with Discipline. It just means that you should keep Finder away from
Discipline.
> ---|---

? MacsBug Reference and Debugging Guide (for MacsBug 6.2), Chapter 6,
p.161

  [1]: http://macintoshgarden.org/apps/macsbug-62