#### Debugging Concepts Cheat Sheet | **Concept** | **Description** | |---------------------|-------------------------------------------------------------------------------------------------------| | **Stack Frame** | A data structure containing information about a function call, including return address, local variables, function parameters, and saved registers. | | **CPU Register** | Small, fast storage locations within the CPU used for temporary data and instructions. Types include general-purpose registers (e.g., `eax`, `ebx`) and special-purpose registers (e.g., instruction pointer, stack pointer). | | **Symbol** | A name representing a variable, function, or other entity in the code, used by debuggers to map human-readable names to memory addresses and other data. | | **Debug Information** | Metadata included in a compiled program to aid in debugging, containing source code mapping, variable information, and function information. | | **DWARF** | A widely-used format for debug information, providing detailed information about the program's structure, including source line information, type information, and call frame information. | ### Example LLDB Commands | **Command** | **Description** | |------------------------------|---------------------------------------------------------------------------------| | `target create --arch x86_64 /path/to/program` | Launch a program. | | `run` | Start the execution of the program. | | `breakpoint set --name main` | Set a breakpoint at the `main` function. | | `continue` | Continue execution after hitting a breakpoint. | | `step` | Step through the code line-by-line. | | `print myVariable` | Print the value of `myVariable`. | | `expr myVariable = 42` | Evaluate an expression to change the value of `myVariable` to `42`. | ### Tags #debugging #lldb #programming #tools #cpu #software-development This cheat sheet encapsulates key concepts and commands for effective debugging using LLDB. #debugging #lldb #CPU #cheatsheet