lldb ¤
Modules:
-
hooks–Code that sets up hooks for LLDB events.
-
pset– -
repl–The Pwndbg REPL that is the interface to all debugging on LLDB.
-
util–
Classes:
-
LLDBRegisters– -
LLDBFrame– -
LLDBThread– -
LLDBType– -
LLDBValue– -
LLDBMemoryMap– -
LLDBStopPoint– -
OneShotAwaitable–Used as part of the logic for the execution controller. This is an Awaitable
-
YieldContinue–Continues execution of the process until the breakpoint or watchpoint given
-
YieldSingleStep–Moves execution of the process being debugged forward by one instruction.
-
LLDBExecutionController– -
LLDBProcess– -
LLDBCommand– -
LLDBPythonState–State of LLDB Python execution.
-
LLDB–
Functions:
-
rename_register–Some register names differ between Pwndbg/GDB and LLDB. This function takes
-
map_type_code–Determines the type code of a given LLDB SBType.
Attributes:
-
T– -
LLDB_VERSION(tuple[int, int]) – -
EXECUTION_CONTROLLER–
LLDBRegisters ¤
LLDBRegisters(groups: SBValueList, proc: LLDBProcess)
LLDBFrame ¤
LLDBFrame(inner: SBFrame, proc: LLDBProcess)
Bases: Frame
Methods:
-
lookup_symbol– -
evaluate_expression– -
regs– -
reg_write– -
pc– -
sp– -
parent– -
child– -
sal– -
__eq__–
Attributes:
-
inner(SBFrame) – -
proc(LLDBProcess) –
LLDBThread ¤
LLDBThread(inner: SBThread, proc: LLDBProcess)
Bases: Thread
Methods:
-
bottom_frame– -
ptid– -
index–
Attributes:
-
inner(SBThread) – -
proc(LLDBProcess) –
LLDBType ¤
Bases: Type
Methods:
-
__eq__– -
func_arguments– -
fields– -
array– -
pointer– -
strip_typedefs– -
target– -
has_field–Whether this type has a field with the given name.
-
keys–Returns a list containing all the field names of this type.
-
enum_member–Retrieve the integer value of an enum member.
-
offsetof–Calculate the byte offset of a field within a struct or union.
Attributes:
-
inner(SBType) – -
name_identifier(str | None) – -
name_to_human_readable(str) – -
sizeof(int) – -
alignof(int) – -
code(TypeCode) – -
array_len(int) –Get array length of this type.
enum_member ¤
Retrieve the integer value of an enum member.
It returns: - integer value, when found field - returns None, If the field does not exist
offsetof ¤
Calculate the byte offset of a field within a struct or union.
This method recursively traverses nested structures and unions, and it computes the byte-aligned offset for the specified field.
It returns: - offset in bytes if found - None if the field doesn't exist or if an unsupported alignment/bit-field is encountered
LLDBValue ¤
LLDBValue(inner: SBValue, proc: LLDBProcess)
Bases: Value
Methods:
-
dereference– -
string– -
value_to_human_readable– -
fetch_lazy– -
__int__– -
cast– -
__add__– -
__sub__– -
__getitem__–
Attributes:
LLDBMemoryMap ¤
LLDBMemoryMap(pages: list[Page])
Bases: MemoryMap
Methods:
-
is_qemu– -
ranges–Returns all ranges in this memory map.
-
lookup_page–
Attributes:
LLDBStopPoint ¤
LLDBStopPoint(
inner: SBBreakpoint | SBWatchpoint,
proc: LLDBProcess,
stop_handler_name: str | None,
)
Bases: StopPoint
Methods:
-
remove– -
set_enabled– -
__enter__– -
__exit__–Automatic breakpoint removal.
Attributes:
-
inner(SBBreakpoint | SBWatchpoint) – -
proc(LLDBProcess) – -
stop_handler_name(str | None) –
OneShotAwaitable ¤
YieldContinue ¤
YieldContinue(target: LLDBStopPoint, selected_thread: bool = False)
Continues execution of the process until the breakpoint or watchpoint given in the constructor is hit or the operation is cancelled.
This class is part of the execution controller system, so it is intented to be yielded by the async function with access to an execution controller, and caught and hanlded by the event loop in the LLDB Pwndbg CLI.
Attributes:
-
target(LLDBStopPoint) – -
selected_thread(bool) –
YieldSingleStep ¤
Moves execution of the process being debugged forward by one instruction.
This class is part of the execution controller system, so it is intented to be yielded by the async function with access to an execution controller, and caught and hanlded by the event loop in the LLDB Pwndbg CLI.
LLDBExecutionController ¤
Bases: ExecutionController
Methods:
LLDBProcess ¤
LLDBProcess(
dbg: LLDB, process: SBProcess, target: SBTarget, is_gdb_remote: bool
)
Bases: Process
Methods:
-
threads– -
pid– -
alive– -
stopped_with_signal– -
evaluate_expression– -
get_known_pages– -
vmmap– -
find_largest_range_len–Finds the largest memory range given a minimum and a maximum value
-
read_memory– -
write_memory– -
find_in_memory– -
is_remote– -
send_remote– -
send_monitor– -
download_remote_file– -
create_value– -
symbol_name_at_address– -
lookup_symbol– -
types_with_name– -
arch– -
break_at– -
trace_ret– -
disasm– -
is_linux– -
module_section_locations– -
main_module_name– -
main_module_entry– -
is_dynamically_linked– -
dispatch_execution_controller– -
runcmd– -
add_symbol_file–Adds a symbol file at base
Attributes:
find_largest_range_len ¤
Finds the largest memory range given a minimum and a maximum value for the size of the rage. This is a binary search, so it should do on the order of log2(max_search - min_search) attempts before it arrives at an answer.
find_in_memory ¤
find_in_memory(
pattern: bytearray,
start: int,
size: int,
align: int,
max_matches: int = -1,
step: int = -1,
) -> Generator[int, None, None]
lookup_symbol ¤
lookup_symbol(
name: str,
*,
prefer_static: bool = False,
type: SymbolLookupType = ANY,
objfile_endswith: str | None = None,
) -> Value | None
break_at ¤
break_at(
location: BreakpointLocation | WatchpointLocation,
stop_handler: Callable[[StopPoint], bool] | None = None,
internal: bool = False,
) -> StopPoint
dispatch_execution_controller ¤
dispatch_execution_controller(
procedure: Callable[[ExecutionController], Coroutine[Any, Any, None]],
)
LLDBCommand ¤
Bases: CommandHandle
Methods:
-
remove–Removes this command from the command palette of the debugger.
Attributes:
LLDBPythonState ¤
Bases: Enum
State of LLDB Python execution.
Unlike in pwndbg-gdb, in pwndbg-lldb the responsibility of driving execution of Python code forward is shared between Pwndbg and LLDB. Knowing which one is in charge is crucial to the correct functioning of the Pwndbg REPL.
This class defines the different kinds of states we can be in.
Attributes:
-
PWNDBG–Pwndbg is driving execution of Python code
-
LLDB_COMMAND_HANDLER–Python code is executing from inside an LLDB command handler
-
LLDB_STOP_HANDLER–Python code is executing from an LLDB breakpoint/watchpoint hook handler
LLDB ¤
Bases: Debugger
Methods:
-
setup– -
relay_exceptions–Relay an exception raised during an LLDB command handler.
-
add_command– -
history– -
commands– -
lex_args– -
selected_inferior– -
selected_thread– -
selected_frame– -
has_event_type– -
event_handler– -
ctx_suspend_once– -
suspend_events– -
resume_events– -
set_sysroot– -
supports_breakpoint_creation_during_stop_handler– -
breakpoint_locations– -
name– -
x86_disassembly_flavor– -
string_limit– -
get_cmd_window_size– -
is_gdblib_available– -
addrsz– -
set_python_diagnostics– -
ctx_suspend_events–Context manager for temporarily suspending and resuming the delivery of events
Attributes:
-
exec_states(list[SBExecutionState]) – -
event_handlers(dict[EventType, list[Callable[..., T]]]) – -
suspended_events(dict[EventType, bool]) – -
prompt_hook(Callable[[], None]) – -
controllers(list[tuple[LLDBProcess, Coroutine[Any, Any, None]]]) – -
lldb_python_state_callback(Callable[[LLDBPythonState], None]) –Callback to the REPL, used to notify it of LLDB driving Python code
-
should_suspend_ctx(bool) – -
pre_ctx_lines(int) –
lldb_python_state_callback instance-attribute ¤
lldb_python_state_callback: Callable[[LLDBPythonState], None]
Callback to the REPL, used to notify it of LLDB driving Python code
relay_exceptions ¤
Relay an exception raised during an LLDB command handler.
add_command ¤
add_command(
command_name: str,
handler: Callable[[Debugger, str, bool], None],
doc: str | None,
) -> CommandHandle
supports_breakpoint_creation_during_stop_handler ¤
rename_register ¤
rename_register(name: str, proc: LLDBProcess) -> str
Some register names differ between Pwndbg/GDB and LLDB. This function takes in a register name in the Pwndbg/GDB convention and returns the equivalent LLDB name for the register.