[all-commits] [llvm/llvm-project] 00bb39: [lldb] Support Python imports relative the to the ...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Tue Oct 27 09:21:07 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 00bb397b0dc79fcad27bfe63456a2100039706f2
      https://github.com/llvm/llvm-project/commit/00bb397b0dc79fcad27bfe63456a2100039706f2
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M lldb/include/lldb/Interpreter/CommandInterpreter.h
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    M lldb/source/Commands/CommandObjectCommands.cpp
    M lldb/source/Commands/Options.td
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
    M lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
    A lldb/test/Shell/ScriptInterpreter/Python/Inputs/hello.split
    A lldb/test/Shell/ScriptInterpreter/Python/Inputs/relative.split
    A lldb/test/Shell/ScriptInterpreter/Python/command_relative_import.test

  Log Message:
  -----------
  [lldb] Support Python imports relative the to the current file being sourced

Make it possible to use a relative path in command script import to the
location of the file being sourced. This allows the user to put Python
scripts next to LLDB command files and importing them without having to
specify an absolute path.

To enable this behavior pass `-c` to `command script import`. The
argument can only be used when sourcing the command from a file.

rdar://68310384

Differential revision: https://reviews.llvm.org/D89334




More information about the All-commits mailing list