Prerequisites for debugging
A compiled program or object file is a sequence of zeros and ones that has no mapping of the original source from which it was compiled. To enable a program to be inspected by a debugger, we need to map the compiled binary instructions to the source file somehow. This is done by injecting extra bookkeeping symbols and instrumentation code during compilation, which the debugger can then latch onto. These symbols are maintained in a symbol table that contains information about the elements of the program, such as the names of variables, functions, and types. They follow a standard format called Debugging With Attributed Record Format (DWARF), which most standard debuggers know how to parse and understand. These symbols ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access