Process Memory Layout on macOS ARM64: Address Spaces, Mach-O Segments, and Debugging with LLDB
· 37 min read
Tools for Inspecting Process Memory and Object Files
Before we even step into the world of virtual memory and process address spaces, let's first learn of some tools which might come in handy when dealing with source programs (we'll describe them in lengths later):
- Object File Inspection. This can be done through various tools such as
otool,objdump, andllvm-objdump. - Debugger. Tools such as
gdbandlldbcan be helpful when inspecting how the program executes. - Virtual Memory Information. Sometimes, we need to see how a process has arranged its virtual memory space. Tools such as
vmmap,leaks, andpmap(also potentiallystrace) can be used for this purpose.
Other tools can come handy frequently as well. For instance, if we want to list the "files" currently owned by the process, lsof provides useful information.
