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 bf8a59fa 2004-04-11 devnull .IR 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 bf8a59fa 2004-04-11 devnull Other manual pages
58 bf8a59fa 2004-04-11 devnull describe the library functions in detail.
59 cfa37a7b 2004-04-10 devnull .PP
60 bf8a59fa 2004-04-11 devnull .I Mach-file (3)
61 bf8a59fa 2004-04-11 devnull describes the manipulation of binary files.
62 cfa37a7b 2004-04-10 devnull .PP
63 bf8a59fa 2004-04-11 devnull .I Mach-map (3)
64 bf8a59fa 2004-04-11 devnull describes the interface to address spaces and register sets
65 bf8a59fa 2004-04-11 devnull in executable files and executing programs.
66 cfa37a7b 2004-04-10 devnull .PP
67 bf8a59fa 2004-04-11 devnull .I Mach-stack (3)
68 bf8a59fa 2004-04-11 devnull describes support for unwinding the stack.
69 cfa37a7b 2004-04-10 devnull .PP
70 bf8a59fa 2004-04-11 devnull .I Mach-swap (3)
71 bf8a59fa 2004-04-11 devnull describes helper functions for accessing data
72 bf8a59fa 2004-04-11 devnull in a particular byte order.
73 cfa37a7b 2004-04-10 devnull .PP
74 bf8a59fa 2004-04-11 devnull .I Mach-symbol (3)
75 bf8a59fa 2004-04-11 devnull describes the interface to debugging symbol information.
76 cfa37a7b 2004-04-10 devnull .SH SOURCE
77 cfa37a7b 2004-04-10 devnull .B /sys/src/libmach
78 bf8a59fa 2004-04-11 devnull .SH "SEE ALSO
79 bf8a59fa 2004-04-11 devnull .IR mach-file (3),
80 bf8a59fa 2004-04-11 devnull .IR mach-map (3),
81 bf8a59fa 2004-04-11 devnull .IR mach-stack (3),
82 bf8a59fa 2004-04-11 devnull .IR mach-swap (3),
83 bf8a59fa 2004-04-11 devnull .IR mach-symbol (3)