Skip to content

proc ¤

Provides values which would be available from /proc which are not fulfilled by other modules and some process/gdb flow related information.

Classes:

Functions:

Attributes:

P module-attribute ¤

P = ParamSpec('P')

T module-attribute ¤

T = TypeVar('T')

pid module-attribute ¤

pid: int

tid module-attribute ¤

tid: int

thread_id module-attribute ¤

thread_id: int

alive module-attribute ¤

alive: bool

stopped_with_signal module-attribute ¤

stopped_with_signal: bool

exe module-attribute ¤

exe: str | None

binary_base_addr module-attribute ¤

binary_base_addr: int

binary_vmmap module-attribute ¤

binary_vmmap: tuple[Page, ...]

tether module-attribute ¤

tether = modules[__name__]

module ¤

Bases: ModuleType

Methods:

Attributes:

pid property ¤

pid: int

tid property ¤

tid: int

thread_id property ¤

thread_id: int

alive property ¤

alive: bool

Informs whether the process has a thread. However, note that it will still return True for a segfaulted thread. To detect that, consider using the stopped_with_signal method.

stopped_with_signal property ¤

stopped_with_signal: bool

Returns whether the program has stopped with a signal

Can be used to detect segfaults (but will also detect other signals)

exe property ¤

exe: str | None

Returns the executed file path.

On remote targets, this path may not exist locally.

If you need the locally referenced file use

gdb.current_process().filename

binary_base_addr property ¤

binary_base_addr: int

binary_vmmap property ¤

binary_vmmap: tuple[Page, ...]

dump_elf_data_section ¤

dump_elf_data_section() -> tuple[int, int, bytes] | None

Dump .data section of current process's ELF file

dump_relocations_by_section_name ¤

dump_relocations_by_section_name(
    section_name: str,
) -> tuple[Relocation, ...] | None

Dump relocations of a section by section name of current process's ELF file

get_section_address_by_name ¤

get_section_address_by_name(section_name: str) -> int

Find section address of current process by section name

OnlyWhenRunning ¤

OnlyWhenRunning(func: Callable[P, T]) -> Callable[P, T | None]

OnlyWhenQemuKernel ¤

OnlyWhenQemuKernel(func: Callable[P, T]) -> Callable[P, T | None]

OnlyWithArch ¤

OnlyWithArch(
    arch_names: list[str],
) -> Callable[[Callable[P, T]], Callable[P, T | None]]

Decorates function to work only with the specified archictectures.

OnlyWhenRunning ¤

OnlyWhenRunning(func: Callable[P, T]) -> Callable[P, T | None]

OnlyWhenQemuKernel ¤

OnlyWhenQemuKernel(func: Callable[P, T]) -> Callable[P, T]

OnlyWithArch ¤

OnlyWithArch(
    arch_names: list[str],
) -> Callable[[Callable[..., T]], Callable[..., T | None]]