From a879f40ba105ab5ceb79725424c77c1fd68a58a1 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 17 Sep 2019 03:55:58 +0000 Subject: [ScriptInterpreter] Initialize globals when loading a scripting module. The LoadScriptingModule used by command script import wasn't initializing the LLDB global variables (things like `lldb.frame` and `lldb.debugger`). They would get initialized however when running the interactive script interpreter or running a single script line (e.g. `script print(lldb.frame)`). This patch fixes that by properly initializing the globals when loading a Python module. Differential revision: https://reviews.llvm.org/D67644 llvm-svn: 372060 --- lldb/lit/Commands/command-script-import.test | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lldb/lit/Commands/command-script-import.test (limited to 'lldb/lit/Commands/command-script-import.test') diff --git a/lldb/lit/Commands/command-script-import.test b/lldb/lit/Commands/command-script-import.test new file mode 100644 index 00000000000..318b4f43540 --- /dev/null +++ b/lldb/lit/Commands/command-script-import.test @@ -0,0 +1,8 @@ +# RUN: echo 'b main' > %t.in +# RUN: echo 'run' >> %t.in +# RUN: echo 'command script import %S/Inputs/frame.py' >> %t.in + +# RUN: %clang -g -O0 %S/../Settings/Inputs/main.c -o %t.out +# RUN: %lldb -b -s %t.in %t.out | FileCheck %s + +# CHECK: frame #0 -- cgit v1.2.3