[Lldb-commits] [PATCH] D105327: [lldb] Add the ability to silently import scripted commands

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 1 18:12:12 PDT 2021


JDevlieghere created this revision.
JDevlieghere added reviewers: teemperor, jingham, clayborg.
Herald added a subscriber: dang.
JDevlieghere requested review of this revision.

Add the ability to silence `command script import`. The motivation for this change is being able to add `command script import -s lldb.macosx.crashlog` to your `~/.lldbinit` without it printing ```"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help.``` at the beginning of every debug session.

In addition to forwarding the `silent` option to `LoadScriptingModule`, this also changes `ScriptInterpreterPythonImpl::ExecuteOneLineWithReturn` and `ScriptInterpreterPythonImpl::ExecuteMultipleLines` to honor the enable IO option in `ExecuteScriptOptions`, which until now was ignored. Note that IO is only enabled (or disabled) at the start of a session, and for this particular use case, that's done when taking the Python lock in `LoadScriptingModule`, which means that the changes to these two functions are not strictly necessary, but (IMO) desirable nonetheless.


https://reviews.llvm.org/D105327

Files:
  lldb/include/lldb/Interpreter/ScriptInterpreter.h
  lldb/source/Commands/CommandObjectCommands.cpp
  lldb/source/Commands/Options.td
  lldb/source/Core/Module.cpp
  lldb/source/Interpreter/ScriptInterpreter.cpp
  lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
  lldb/test/Shell/ScriptInterpreter/Python/silent_command_script_import.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105327.356065.patch
Type: text/x-patch
Size: 14991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210702/30682aab/attachment-0001.bin>


More information about the lldb-commits mailing list