From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/mach-cmd.html | 167 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 man/man3/mach-cmd.html (limited to 'man/man3/mach-cmd.html') diff --git a/man/man3/mach-cmd.html b/man/man3/mach-cmd.html new file mode 100644 index 00000000..978e80b5 --- /dev/null +++ b/man/man3/mach-cmd.html @@ -0,0 +1,167 @@ + +mach-cmd(3) - Plan 9 from User Space + + + + +
+
+
MACH-CMD(3)MACH-CMD(3) +
+
+

NAME
+ +
+ + attachargs, attachcore, attachdynamic, attachproc, proctextfile + – debugging processes and core files
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h>
+ #include <mach.h> +
+
+ int      attachcore(Fhdr *hdr) +
+
+ int      attachproc(int pid) +
+
+ int      attachdynamic(void) +
+
+ char*    proctextfile(int pid) +
+
+ int      attachargs(int argc, char **argv, int omode) +
+
+ extern Fhdr* symhdr;
+
extern     char*    symfil;
+ extern     Map*    symmap;
+ extern     Fhdr*    fhdrlist;
+ extern     Fhdr*    corhdr;
+ extern     char*    corfil;
+ extern     Map*    cormap;
+ extern     int      corpid;
+ extern     Regs*    correg;
+ +
+

DESCRIPTION
+ +
+ + These routines provide access to the objects a typical debugger + manipulates: an executable binary, some number of shared libraries, + a memory image in the form of a core dump or active process, and + a register set. +
+ + The maintained state is:
+ symhdr
+
+
+ + The file header for the main binary.
+ +
+ symfilThe file name of the main binary.
+ symmap
+
+
+ + The memory map of the main binary.
+ +
+ fhdrlist
+
+
+ + A linked list (via the Fhdr.next fields) of all currently open + headers (see symopen in mach-symbol(3)). When dynamically linked + objects have been attached, they are present in this linked list, + and therefore included in searches by indexsym, lookupsym, and + findsym (see mach-symbol(3)). + +
+ corhdrThe file header for the core dump, if any.
+ corfilThe file name of the core dump, if any.
+ cormap
+
+
+ + The memory map of the core dump or attached process.
+ +
+ corpidThe process id of the attached process, if any.
+ corregThe register set of the core dump or attached process. If + these fields are not valid, they are zeroed. +
+ + Attachcore and attachproc attach to an opened core file or an + executing process. They set corhdr, corfil, cormap, corpid, and + correg. +
+ + Proctextfile returns the name of the main binary for the process + with id pid. +
+ + Attachdynamic requires that the memory image already be attached. + It reads the dynamic linker’s internal run-time data structures + and then opens all the dynamic objects that are currently loaded. + +
+ + Attachargs uses all of these functions while parsing an argument + vector as would be passed to a debugger like db(1) or acid(1). + It expects a list of executable files, core dump files, or process + ids, given in any order. If extra arguments are given (for example, + more than one executable, or both a core dump and a + process id), they are ignored and diagnostics are printed to standard + error. If arguments are missing (for example, the process id is + given without an executable file), attachargs fills them in as + best it can.
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/libmach
+
+
+

SEE ALSO
+ +
+ + mach(3), mach-file(3), mach-map(3)
+ +
+

BUGS
+ +
+ + The interface needs to be changed to support multiple threads, + each with its own register set.
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3