virtual bool
LoadScriptingModule(const char *filename, bool can_reload, bool init_session,
lldb_private::Status &error,
- StructuredData::ObjectSP *module_sp = nullptr) {
- error.SetErrorString("loading unimplemented");
- return false;
- }
+ StructuredData::ObjectSP *module_sp = nullptr);
virtual bool IsReservedWord(const char *word) { return false; }
};
bool DoExecute(Args &command, CommandReturnObject &result) override {
- if (GetDebugger().GetScriptLanguage() != lldb::eScriptLanguagePython) {
- result.AppendError("only scripting language supported for module "
- "importing is currently Python");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
if (command.empty()) {
result.AppendError("command script import needs one or more arguments");
result.SetStatus(eReturnStatusFailed);
"This script interpreter does not support watchpoint callbacks.");
}
+bool ScriptInterpreter::LoadScriptingModule(
+ const char *filename, bool can_reload, bool init_session,
+ lldb_private::Status &error, StructuredData::ObjectSP *module_sp) {
+ error.SetErrorString(
+ "This script interpreter does not support importing modules.");
+ return false;
+}
+
std::string ScriptInterpreter::LanguageToString(lldb::ScriptLanguage language) {
switch (language) {
case eScriptLanguageNone:
--- /dev/null
+# RUN: %lldb --script-language none -o 'command script import %t' 2>&1 | FileCheck %s
+# CHECK: error: module importing failed: This script interpreter does not support importing modules.