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:
-
LLDBArch
– -
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
– -
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
–
LLDBArch ¤
LLDBArch(
name: PWNDBG_SUPPORTED_ARCHITECTURES_TYPE,
ptrsize: int,
endian: Literal["little", "big"],
)
Bases: Arch
Attributes:
-
endian
(Literal['little', 'big']
) – -
name
(PWNDBG_SUPPORTED_ARCHITECTURES_TYPE
) – -
ptrsize
(int
) –
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
) –
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:
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)
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
) –
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 ¤
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
– -
disasm
– -
is_linux
– -
module_section_locations
– -
main_module_name
– -
main_module_entry
– -
is_dynamically_linked
– -
dispatch_execution_controller
–
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:
LLDB ¤
Bases: Debugger
Methods:
-
setup
– -
add_command
– -
history
– -
commands
– -
lex_args
– -
selected_inferior
– -
selected_thread
– -
selected_frame
– -
has_event_type
– -
event_handler
– -
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
–
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]]]
) – -
pre_ctx_lines
(int
) –
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.