Libmach provides an interface for accessing
the executable files and executing images of various architectures
and operating systems.
The interface is machine-independent, meaning that, for example,
Mac OS X core dumps may be inspected using an x86 Linux machine
and vice versa.
In its current form,
the library is mainly useful for writing debuggers
of one sort or another.
An architecture is described primarily by a
Mach structure, which contains
data structures and parameters describing the
Most library functions assume that the global variable
mach points at the structure for the architecture being debugged.
It is set implicitly by
and can be set explicitly by calling
There is no operating system-specific structure akin to
mach. Typically the choice of operating system on a particular
architecture affects only the executable and core dump formats;
the various file parsers deduce the operating system from
information in the binary files themselves and adjust
The supported architectures are
386 (Intel 32-bit x86)
386 and later)
power (IBM PowerPC, typically running
Mac OS X).
Other manual pages
describe the library functions in detail.
describes some convenience routines for attaching to
processes and core files.
describes the manipulation of binary files.
describes the interface to address spaces and register sets
in executable files and executing programs.
describes support for unwinding the stack.
describes helper functions for accessing data
in a particular byte order.
describes the interface to debugging symbol information.