Skip to content

Add docs and an example use of the scripted command get_flags API. #109176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lldb/docs/use/python-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,12 @@ which should implement the following interface:
this call should return the short help text for this command[1]
def get_long_help(self):
this call should return the long help text for this command[1]
def get_flags(self):
this will be called when the command is added to the command interpreter,
and should return a flag field made from or-ing together the appropriate
elements of the lldb.CommandFlags enum to specify the requirements of this command.
The CommandInterpreter will make sure all these requirements are met, and will
return the standard lldb error if they are not.[1]
def get_repeat_command(self, command):
The auto-repeat command is what will get executed when the user types just
a return at the next prompt after this command is run. Even if your command
Expand Down
3 changes: 3 additions & 0 deletions lldb/examples/python/cmdtemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def register_lldb_command(cls, debugger, module_name):
'--help" for detailed help.'.format(cls.program)
)

def get_flags(self):
return lldb.eCommandRequiresFrame | lldb.eCommandProcessMustBePaused

def setup_command_definition(self):

self.ov_parser.add_option(
Expand Down
Loading