ScriptedCommand#

class lldb.plugins.scripted_command.ScriptedCommand(debugger: SBDebugger)#

The base class for a scripted (raw) command.

A raw command receives the unparsed argument string exactly as the user typed it, and is responsible for any parsing it needs. For a command with a table-driven option/argument parser, see ParsedCommand instead. Register it with command script add -c <ClassName> ....

Most of the base class methods are @abstractmethod that need to be overwritten by the inheriting class.

Methods Summary

__call__(debugger, args, exe_ctx, result)

Execute the command.

get_flags()

Command flags (a bitmask of lldb.eCommandRequires*/ lldb.eCommandProcessMustBe* etc.) controlling when this command is available.

get_long_help()

The full help text shown by help.

get_repeat_command(command)

Customize what runs when the user presses Enter to repeat this command.

get_short_help()

A one-line description shown by help.

Methods Documentation

abstract __call__(debugger: SBDebugger, args: str, exe_ctx: SBExecutionContext, result: SBCommandReturnObject) None#

Execute the command.

Parameters:
get_flags() int#

Command flags (a bitmask of lldb.eCommandRequires*/ lldb.eCommandProcessMustBe* etc.) controlling when this command is available.

Returns:

The flags bitmask. Defaults to 0 (no restrictions).

Return type:

int

get_long_help() str | None#

The full help text shown by help.

Returns:

The long help string.

Return type:

str

get_repeat_command(command: str) str | None#

Customize what runs when the user presses Enter to repeat this command.

Parameters:

command (str) – The command line that was run.

Returns:

The command line to run on repeat. Defaults to None, meaning repeat the original command unmodified.

Return type:

str

get_short_help() str | None#

A one-line description shown by help.

Returns:

The short help string.

Return type:

str