Blame


1 cfa37a7b 2004-04-10 devnull .TH MACH 3
2 cfa37a7b 2004-04-10 devnull .SH NAME
3 bf8a59fa 2004-04-11 devnull machbytype, machbyname \- machine-independent access to executables and programs
4 cfa37a7b 2004-04-10 devnull .SH SYNOPSIS
5 cfa37a7b 2004-04-10 devnull .B #include <u.h>
6 cfa37a7b 2004-04-10 devnull .br
7 cfa37a7b 2004-04-10 devnull .B #include <libc.h>
8 cfa37a7b 2004-04-10 devnull .br
9 cfa37a7b 2004-04-10 devnull .B #include <mach.h>
10 cfa37a7b 2004-04-10 devnull .PP
11 cfa37a7b 2004-04-10 devnull .PP
12 cfa37a7b 2004-04-10 devnull .B
13 cfa37a7b 2004-04-10 devnull void machbytype(int type)
14 cfa37a7b 2004-04-10 devnull .PP
15 cfa37a7b 2004-04-10 devnull .B
16 cfa37a7b 2004-04-10 devnull int machbyname(char *name)
17 cfa37a7b 2004-04-10 devnull .PP
18 cfa37a7b 2004-04-10 devnull .B
19 bf8a59fa 2004-04-11 devnull extern Mach *mach;
20 cfa37a7b 2004-04-10 devnull .SH DESCRIPTION
21 bf8a59fa 2004-04-11 devnull .I Libmach
22 bf8a59fa 2004-04-11 devnull provides an interface for accessing
23 bf8a59fa 2004-04-11 devnull the executable files and executing images of various architectures
24 bf8a59fa 2004-04-11 devnull and operating systems.
25 bf8a59fa 2004-04-11 devnull The interface is machine-independent, meaning that, for example,
26 bf8a59fa 2004-04-11 devnull Mac OS X core dumps may be inspected using an x86 Linux machine
27 bf8a59fa 2004-04-11 devnull and vice versa.
28 bf8a59fa 2004-04-11 devnull In its current form,
29 bf8a59fa 2004-04-11 devnull the library is mainly useful for writing debuggers
30 bf8a59fa 2004-04-11 devnull of one sort or another.
31 cfa37a7b 2004-04-10 devnull .PP
32 bf8a59fa 2004-04-11 devnull An architecture is described primarily by a
33 cfa37a7b 2004-04-10 devnull .B Mach
34 bf8a59fa 2004-04-11 devnull structure, which contains
35 bf8a59fa 2004-04-11 devnull data structures and parameters describing the
36 bf8a59fa 2004-04-11 devnull particular architecture.
37 bf8a59fa 2004-04-11 devnull Most library functions assume that the global variable
38 cfa37a7b 2004-04-10 devnull .I mach
39 bf8a59fa 2004-04-11 devnull points at the structure for the architecture being debugged.
40 bf8a59fa 2004-04-11 devnull It is set implicitly by
41 bf8a59fa 2004-04-11 devnull .I crackhdr
42 bf8a59fa 2004-04-11 devnull (see
43 d32deab1 2020-08-16 rsc .MR mach-file (3) )
44 bf8a59fa 2004-04-11 devnull and can be set explicitly by calling
45 bf8a59fa 2004-04-11 devnull .I machbyname
46 bf8a59fa 2004-04-11 devnull or
47 bf8a59fa 2004-04-11 devnull .IR machbytype .
48 cfa37a7b 2004-04-10 devnull .PP
49 bf8a59fa 2004-04-11 devnull There is no operating system-specific structure akin to
50 bf8a59fa 2004-04-11 devnull .IR mach .
51 bf8a59fa 2004-04-11 devnull Typically the choice of operating system on a particular
52 bf8a59fa 2004-04-11 devnull architecture affects only the executable and core dump formats;
53 bf8a59fa 2004-04-11 devnull the various file parsers deduce the operating system from
54 bf8a59fa 2004-04-11 devnull information in the binary files themselves and adjust
55 bf8a59fa 2004-04-11 devnull accordingly.
56 cfa37a7b 2004-04-10 devnull .PP
57 058b0118 2005-01-03 devnull The supported architectures are
58 058b0118 2005-01-03 devnull .B 386
59 058b0118 2005-01-03 devnull (Intel 32-bit x86)
60 058b0118 2005-01-03 devnull 386 and later)
61 058b0118 2005-01-03 devnull and
62 058b0118 2005-01-03 devnull .B power
63 058b0118 2005-01-03 devnull (IBM PowerPC, typically running
64 058b0118 2005-01-03 devnull Mac OS X).
65 058b0118 2005-01-03 devnull .PP
66 bf8a59fa 2004-04-11 devnull Other manual pages
67 bf8a59fa 2004-04-11 devnull describe the library functions in detail.
68 cfa37a7b 2004-04-10 devnull .PP
69 d32deab1 2020-08-16 rsc .MR Mach-cmd (3)
70 058b0118 2005-01-03 devnull describes some convenience routines for attaching to
71 058b0118 2005-01-03 devnull processes and core files.
72 058b0118 2005-01-03 devnull .PP
73 d32deab1 2020-08-16 rsc .MR Mach-file (3)
74 bf8a59fa 2004-04-11 devnull describes the manipulation of binary files.
75 cfa37a7b 2004-04-10 devnull .PP
76 d32deab1 2020-08-16 rsc .MR Mach-map (3)
77 bf8a59fa 2004-04-11 devnull describes the interface to address spaces and register sets
78 bf8a59fa 2004-04-11 devnull in executable files and executing programs.
79 cfa37a7b 2004-04-10 devnull .PP
80 d32deab1 2020-08-16 rsc .MR Mach-stack (3)
81 bf8a59fa 2004-04-11 devnull describes support for unwinding the stack.
82 cfa37a7b 2004-04-10 devnull .PP
83 d32deab1 2020-08-16 rsc .MR Mach-swap (3)
84 bf8a59fa 2004-04-11 devnull describes helper functions for accessing data
85 bf8a59fa 2004-04-11 devnull in a particular byte order.
86 cfa37a7b 2004-04-10 devnull .PP
87 d32deab1 2020-08-16 rsc .MR Mach-symbol (3)
88 bf8a59fa 2004-04-11 devnull describes the interface to debugging symbol information.
89 cfa37a7b 2004-04-10 devnull .SH SOURCE
90 c3674de4 2005-01-11 devnull .B \*9/src/libmach
91 bf8a59fa 2004-04-11 devnull .SH "SEE ALSO
92 d32deab1 2020-08-16 rsc .MR mach-file (3) ,
93 d32deab1 2020-08-16 rsc .MR mach-map (3) ,
94 d32deab1 2020-08-16 rsc .MR mach-stack (3) ,
95 d32deab1 2020-08-16 rsc .MR mach-swap (3) ,
96 d32deab1 2020-08-16 rsc .MR mach-symbol (3)