Terms
In this book, we will introduce knowledge about compilers, linkers, operating systems, debuggers, debugging information standards, and software development. There will be many terms used. Here we list common important terms for readers' convenient reference.
Term | Description |
---|---|
Source | Source code, such as code written in Go language |
Compiler | Compiler, compiles source code into object files |
Linker | Linker, links object files, shared libraries, and system startup code together to build executable programs |
Debugger | Debugger, tracks running processes or loads a core file, loads program or core file debugging symbol information, explores, modifies, and controls process runtime state, such as pausing execution and viewing memory and registers |
DWARF | DWARF is a debugging information standard that guides compilers to generate debugging information into object files, guides linkers to merge debugging information stored in multiple object files, and debuggers to load this debugging information. In short, DWARF is used to coordinate work between compilers, linkers, and debuggers |
Debugger types | Generally, debuggers can be divided into two types: instruction-level debuggers and symbol-level debuggers |
Instruction level debugger | Instruction-level debugger, which operates on machine instructions. Instruction-level debugging can be implemented through processor instruction patching technology without requiring debugging symbol information. It is only suitable for instruction or assembly language level operations and does not support source code level operations. |
Symbol level debugger | Symbol-level debugger, which operates not only on machine instructions but more importantly supports source code level operations. It can extract and parse debugging symbol information, establish mapping relationships between memory addresses, instruction addresses, and source code, support converting source code statement breakpoints into precise machine instruction breakpoints, and support other convenient operations |
Tracee | Generally refers to the process being debugged. More precisely, tracee refers to the thread being tracked by the debugger. A process being debugged may also be a multi-threaded program, so if multiple threads need to be debugged and tracked, there will be multiple tracees |
Tracer | Generally refers to the process corresponding to the debugger. More precisely (taking Linux as an example), tracer refers to the thread in the debugger that establishes a tracking relationship with the tracee through the ptrace_attach system call. The Linux kernel requires that subsequent ptrace requests after ptrace attach must come from the thread that initiated the ptrace attach request, so Linux debugger implementations often have a tracer that is responsible for tracking multiple tracees in the debugged process |