HomePhabricator

Fix and simplify lldb.command decorator

Description

Fix and simplify lldb.command decorator

Summary:
This change fixes one issue with lldb.command, and also reduces the implementation.

The fix: a command function's docstring was not shown when running help <command_name>. This is because the docstring attached the source function is not propagated to the decorated function (f.__call__). By returning the original function, the docstring will be properly displayed by help.

Also with this change, the command name is assumed to be the function's name, but can still be explicitly defined as previously.

Additionally, the implementation was updated to:

  • Remove inner class
  • Remove use of inspect module
  • Remove *args and **kwargs

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: keith, xiaobai, lldb-commits

Differential Revision: https://reviews.llvm.org/D48658

Details

Committed
kastiglioneJul 4 2018, 9:11 AM
Reviewer
clayborg
Differential Revision
D48658: Fix and simplify lldb.command decorator
Branches
Unknown
Tags
Unknown