MacsBug
Encyclopedia
MacsBug is a low-level debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...

 for pre-Mac OS X Macintosh
Macintosh
The Macintosh , or Mac, is a series of several lines of personal computers designed, developed, and marketed by Apple Inc. The first Macintosh was introduced by Apple's then-chairman Steve Jobs on January 24, 1984; it was the first commercially successful personal computer to feature a mouse and a...

 operating systems. MacsBug is an acronym for Motorola Advanced Computer Systems Debugger, as opposed to Macintosh debugger (The Motorola 68000 Microprocessor is imprinted with the MACSS acronym). The original version was developed by Motorola as a general debugger for its 68000
Motorola 68000
The Motorola 68000 is a 16/32-bit CISC microprocessor core designed and marketed by Freescale Semiconductor...

 systems — it was ported to the Mac as a programmer's tool early in the project's development.

MacsBug is invoked by hitting the Macintosh's "Programmer's Key
Programmer's key
The Programmer's Key, or interrupt button, is a button or switch on a computer which causes an asynchronous interrupt request to be sent to the processor. If a debugger is installed on the machine, it is activated when the interrupt request is processed, allowing the user to view and usually...

" or, as it became later known, the "Interrupt Key" or by pressing "Command-Power". MacsBug offers many commands for disassembling
Disassembler
A disassembler is a computer program that translates machine language into assembly language—the inverse operation to that of an assembler. A disassembler differs from a decompiler, which targets a high-level language rather than an assembly language...

, searching, and viewing data as well as control over processor register
Processor register
In computer architecture, a processor register is a small amount of storage available as part of a CPU or other digital processor. Such registers are addressed by mechanisms other than main memory and can be accessed more quickly...

s. MacsBug is not installed by default with Mac OS, although every Macintosh since the Macintosh Plus includes a debugger in ROM known as MicroBug.

Users that stumble into MacsBug by accident need only to enter G and press return to escape from MacsBug; however, MacsBug is not installed by default, requiring a system extension, so a typical user environment does not include it. However, it was occasionally installed by end users to provide very basic error recovery. As the classic Mac OS lacked memory protection
Memory protection
Memory protection is a way to control memory access rights on a computer, and is a part of most modern operating systems. The main purpose of memory protection is to prevent a process from accessing memory that has not been allocated to it. This prevents a bug within a process from affecting...

 "hard crashes" where an application crash simply froze the entire system weren't uncommon. With MacsBug installed, instead of an unresponsive system, the user would be dumped into MacsBug, where they could type ES to Exit to Shell (force quit the crashed application and return to the Finder) or RB for ReBoot, which restarted the system. Such recovery efforts were often not successful, but the only alternative was a physical reset switch.

The presence of MacsBug is indicated at startup; it is present if the user sees the text Debugger installed (although, occasionally, this may indicate the presence of another piece of software loaded into the area of memory reserved for the debugger, instead).

MacsBug was originally for the Motorola 68000 series of processors only. When Apple introduced the Power Macintosh
Power Macintosh
Power Macintosh, later Power Mac, was a line of Apple Macintosh workstation-class personal computers based on various models of PowerPC microprocessors that were developed, marketed, and supported by Apple Inc. from March 1994 until August 2006. The first models were the Power Macintosh 6100,...

 in 1994, it was followed by an updated MacsBug that supported the PowerPC
PowerPC
PowerPC is a RISC architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM...

 instruction set and architecture.

The last version of MacsBug was 6.6.3, released September 14, 2000. This final version works with all of the machines released in the July–September timeframe of 2000, including the Power Mac G4
Power Mac G4
The Power Mac G4 was a series of personal computers that was designed, manufactured, and sold by Apple between 1999 and 2004. They used the PowerPC G4 series of microprocessors. They were heralded by Apple to be the first personal supercomputers, reaching speeds of 4 to 20 Gigaflops...

 (uni- and multi-processor), Power Mac G4 Cube
Power Mac G4 Cube
The Power Mac G4 Cube was a small form factor Macintosh personal computer from Apple Inc. It was sold from 2000 to 2001. Its cube shape is reminiscent of the NeXTcube from NeXT, acquired by Apple in 1996. The machine was designed by Apple industrial designer Jonathan Ive...

, the iMac
IMac
The iMac is a range of all-in-one Macintosh desktop computers built by Apple. It has been the primary part of Apple's consumer desktop offerings since its introduction in 1998, and has evolved through five distinct forms....

 family (Ruby, Indigo, Sage, Graphite, and Snow), and the iBook
IBook
The iBook was a line of laptop computers sold by Apple Computer from 1999 to 2006. The line targeted the consumer and education markets, with lower specifications and prices than the PowerBook, Apple's higher-end line of laptop computers....

 family (Indigo, Key Lime, and Graphite).

6.6.3 includes better support for debugging MP tasks, and fixes some serious bugs in the memory setting commands when used in PCI
Peripheral Component Interconnect
Conventional PCI is a computer bus for attaching hardware devices in a computer...

 I/O space. It can also be used in Classic
Classic (Mac OS X)
Classic, or Classic Environment, was a hardware and software abstraction layer in Mac OS X that allowed applications compatible with Mac OS 9 to run on the Mac OS X operating system...

 when running under Mac OS X, where it is invoked by pressing "⌘-⏏" (or "⌘-F12" on systems without an Eject key).

Mac OS X allows programmers to use familiar MacsBug commands in gdb. This gdb plugin is included with the OS X Developer Tools, located in the directory /usr/libexec/gdb/plugins/MacsBug/.

Third party alternatives to MacsBug included ICOM Simulations
ICOM Simulations
ICOM Simulations was a software company based in Wheeling, Illinois. It is best known for creating the MacVenture series of adventure games including Shadowgate.Following the foundation in 1983 a number of game titles for the Panasonic JR-200 were produced...

' TMON which came with the Darin Adler Extended User Area & Trap Discipline (allowing all documented Mac API parameters to be verified) and the fully symbolic Jasik debugger
Jasik debugger
The Jasik Debugger , was a debugger tool for the classic Macintosh operating system. Pitched as a much more powerful alternative to Macsbug, it was the debugger of choice among professional Mac developers until the advent of more advanced source-level debuggers such as that built into Metrowerks...

, which was much more powerful, but harder to use due to the intricate and non-standard user interface.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK