Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Use __lldb_init_module instead of "if lldb.debugger" idiom
Update examples and docs to demonstrate using `__lldb_init_module` instead of the idiom that checks for `lldb.debugger` at the top-level. ``` if __name__ == '__main__': ... elif lldb.debugger: ... ``` Is replaced with: ``` if __name__ == '__main__': ... def __lldb_init_module(debugger, internal_dict): ... ``` This change is for two reasons. First, it's generally encouraged not to only use the convenience singletons (`lldb.{debugger,process,target,etc}`) interactively from the `script` command. Second, there's a bug where registering a python class as a command (using `command script add -c ...`), result in the command not being runnable. Note that registering function-backed commands does not have this bug. Differential Revision: https://reviews.llvm.org/D117237
- Loading branch information
1 parent
bc56097
commit 1441ffe
Showing
10 changed files
with
77 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters