Manual Reference Pages - MACH-CMD (3)
attachargs, attachcore, attachdynamic, attachproc, proctextfile - debugging processes and core files
int attachcore(Fhdr *hdr)
int attachproc(int pid)
char* proctextfile(int pid)
int attachargs(int argc, char **argv, int omode)
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:
attachproc attach to an opened core file or an executing process.
The file header for the main binary.
The file name of the main binary.
The memory map of the main binary.
A linked list (via the
Fhdr.next fields) of all currently open headers
When dynamically linked objects have been attached,
they are present in this linked list,
and therefore included in searches by
The file header for the core dump, if any.
The file name of the core dump, if any.
The memory map of the core dump or attached process.
The process id of the attached process, if any.
The register set of the core dump or attached process.
If these fields are not valid, they are zeroed.
Proctextfile returns the name of the main binary for the process with id
Attachdynamic requires that the memory image already be attached.
It reads the dynamic linkers internal run-time data structures
and then opens all the dynamic objects that are currently
Attachargs uses all of these functions while
parsing an argument vector as would be passed to
a debugger like
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
If arguments are missing (for example, the process id is given without an
attachargs fills them in as best it can.
The interface needs to be changed to support
multiple threads, each with its own register set.
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.