Module minidump_writer::mach
source · Expand description
Contains various helpers to improve and expand on the bindings provided
by mach2
Modules§
- This module corresponds to
mach/task.defs
. - This module roughly corresponds to
mach/task_info.h
.
Structs§
- Dynamically linked shared libraries are identified by two things. The pathname (the name of the library as found for execution), and the compatibility version number. The pathname must match and the compatibility number in the user of the library must be greater than or equal to the library being used. The time stamp is used to record the time a library was built and copied into user so it can be use to determined if the library used at runtime is exactly the same as used to built the program.
- A dynamically linked shared library (filetype == MH_DYLIB in the mach header) contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library. An object that uses a dynamically linked shared library also contains a dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or LC_REEXPORT_DYLIB) for each library it uses.
- Every load command is a variable sized struct depending on its type, but they all include the fields in this struct at the beginning
- A block of load commands for a particular image
- The header at the beginning of every (valid) Mach image
- The 64-bit segment load command indicates that a part of this file is to be mapped into a 64-bit task’s address space. If the 64-bit segment has sections then section_64 structures directly follow the 64-bit segment command and their size is reflected in
cmdsize
. - The uuid load command contains a single 128-bit unique random number that identifies an object produced by the static link editor.
Enums§
- A Mach kernel error.
- A single load command
- Load command constants from usr/include/mach-o/loader.h
Constants§
- <usr/include/mach-o/loader.h>, the file type dyld, the dynamic loader
- <usr/include/mach-o/loader.h>, the file type for the main executable image
- x86_THREAD_STATE64 in /usr/include/mach/i386/thread_status.h
Traits§
- Minimal trait that just pairs a structure that can be filled out by
mach2::task::task_info
with the “flavor” that tells it the info we actually want to retrieve - Minimal trait that just pairs a structure that can be filled out by
thread_info
with the “flavor” that tells it the info we actually want to retrieve
Functions§
- Retrieves an
i32
sysctl by name and casts it to the specified integer type. Returns the default value if retrieval fails or the value is out of bounds of the specified integer type. - From <usr/include/mach/mach_traps.h>, this retrieves the normal PID for the specified task as the syscalls from BSD use PIDs, not mach ports.
- Retrieves an integer sysctl by name. Returns the default value if retrieval fails.
- Retrieves a string sysctl by name. Returns an empty string if the retrieval fails or the string can’t be converted to utf-8.
- Fomr <user/include/mach/thread_act.h>, this retrieves thread info for the for the specified thread.