[Lldb-commits] [PATCH] D86996: [lldb] Add -l/--language option to script command

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 1 19:28:55 PDT 2020


kastiglione added inline comments.


================
Comment at: lldb/source/Commands/CommandObjectScript.cpp:65
+
+  return CommandParsed(command);
+}
----------------
this is missing error handling for unsupported languages, such as `script -l swift`


================
Comment at: lldb/test/Shell/ScriptInterpreter/Lua/lua-python.test:7
+# RUN: cd %t
+# RUN: echo "int main() { return 0; }" | %clang_host -x c - -o a.out
+# RUN: cat %s | %lldb 2>&1 | FileCheck %s
----------------
is `a.out` not a universal default?


================
Comment at: lldb/test/Shell/ScriptInterpreter/Python/python.test:8
+# RUN: %lldb -o 'script --language invalid print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s --check-prefix INVALID
+# INVALID: SyntaxError
+# INVALID-NOT: 1111
----------------
So this `SyntaxError` is from python because it's attempting to evaluate `--language invalid print(...)`? I think it'd be good to handle unknown languages, but maybe you have a reason for this?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86996/new/

https://reviews.llvm.org/D86996



More information about the lldb-commits mailing list