CodeLLDB:
CodeLLDB is a powerful and flexible debugger extension for Visual Studio Code. It provides advanced debugging features for C, C++, and Rust applications.
LLDB Commands
Start Debugging a Program:
lldb <program>Run the Program:
runSet a Breakpoint:
breakpoint set --name <function_name>Sets a breakpoint at the specified function.
Set a Breakpoint at a Specific Line:
breakpoint set --file <filename> --line <line_number>Sets a breakpoint at a specific line in a file.
Set Conditional Breakpoints:
breakpoint set --name <function_name> --condition "<condition>"Sets a breakpoint that only triggers when the condition is true.
List Breakpoints:
breakpoint listDisplays all breakpoints.
Step Over a Line:
nextExecutes the next line of code but steps over function calls.
Step Into a Function:
stepSteps into a function if the current line calls one.
Continue Execution:
continueInspect Variables:
frame variable <variable_name>Displays the value of a variable in the current scope.
Watch a Variable:
watchpoint set variable <variable_name>Sets a watchpoint to monitor changes to a variable.
Inspect Call Stack:
thread backtraceDisplays the call stack of the current thread.
Inspect Memory:
memory read <address> --size <size>Reads memory from the specified address.
Examine Memory:
memory read <address> --size <size> --format <format>Reads the memory at a specific address. You can specify the size (--size) and format (--format, e.g., x for hexadecimal).
Dump Memory in Hexadecimal:
memory read <address> --size <size> --format xDumps memory in a hexadecimal format for easier inspection.
View Registers:
register readDisplays the values of all CPU registers.
Change Register Values:
register write <register_name> <value>Modifies the value of a register.
List Disassembled Code:
disassemble --frameDisassembles the current function’s code.
Disassemble a Specific Function:
disassemble --name <function_name>Disassembles a specific function by name.
Evaluate Expressions:
expression <expression>Evaluates an expression and print the result.
Comments
Post a Comment