ADC Home > Reference Library > Technical Notes > Legacy Documents > Hardware & Drivers >
Legacy Document
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
About MicroBugMicroBug was first introduced with the Mac Plus and has been a standard component in the ROM of all Mac OS computers since then. MicroBug is invoked when the system takes a Non-Maskable Interrupt (NMI) and there is no other debugger (e.g., MacsBug) installed. MicroBug is not present on the Macintosh 128, Macintosh 512, and Macintosh XL computers. EnvironmentMicroBug uses standard system services to operate its user interface. Specifically, MicroBug uses QuickDraw to draw its window and the Event Manager to get keyboard events. Internally, it shares a lot of code with the System Error Handler. This stands in contrast to MacsBug, which uses its own low-level drawing and input handling routines. The upshot is that MicroBug is less likely to be functional in the face of a "damaged" system than MacsBug. ExpressionsMicroBug expressions consist of:
All expressions have an inherent size, which is the number of valid bytes the expression returns. The size of a hex number is determined by the number of hex digits in the number. One or two hex digits yields a size of one (1) byte, three or four hex digits yields a size of two (2) bytes, and five or more hex digits yields a size of four (4) bytes. The size of ".", indirect, and all register expressions is four (4) bytes. The size of an arithmetic expression is the maximum of the size of the components. MicroBug CommandsDump Memory
With an argument, the dump memory command dumps the
contents of memory at the address specified by
Both variants set the dot address to the address where the dump started. Typing Return after entering this command will continue dumping memory. Set Memory
The set memory command sets the contents of memory,
starting at the address specified by The command sets the dot address to the address where the dump started. Typing Return after entering this command will continue dumping memory. Go
With an argument, the go command starts execution at the
address specified by Total Display
Displays all the standard
Typing Return after entering this command will repeat the command. Set and Display Register
With an argument, these command set the specified
register to the Typing Return after entering one of these commands will repeat the command. MicroBug EsotericaForce QuittingIf you want to force quit the current process, you can just type:
This places an Some enterprising souls have discovered that commands like:
will also force quit an application. This is because MicroBug's expression evaluator is extremely forgiving, so seemingly irrelevant strings will successfully evaluate to expressions. In both cases shown above, the resulting value is odd. Going to an odd address causes the 680x0 microprocessor (or the emulated microprocessor, on PowerPC-based computers) to take an "address error" exception. Mac OS responds to this exception by terminating the current process, which was the desired result. Given the serendipitous nature of this feature, DTS continues to recommend the first sequence of commands.
Using this algorithm, the value for "FINDER" is
MicroBug and the ModemIf you crash into the debugger and the system hangs, try turning off your modem.
Using MicroBug SeriouslyIf you're using MicroBug to debug a problem, it
really pays off to have another machine running
MacsBug right next to it. You can then use MacsBug commands
to assist in your debugging. MacsBug commands like
SummaryMacsBug is your friend. MicroBug is much less of your friend, but when you're a Mac programmer with a bug that disappears when you install MacsBug, you need all the friends you can get. ReferencesMacsBug Reference and Debugging Guide, for MacsBug version 6.2 , Apple Computer, Inc., Addison-Wesley, 1990 Change History
Downloadables
|