Skip to content

Commit fc1fd6b

Browse files
committed
Fix command-script-import.test on linux
The test was expecting the value of "lldb.frame" to be None, because it is cleared after each python interpreter session. However, this is not true in the very first session, because lldb.py sets these values to invalid objects (lldb.SBFrame(), etc.). I have not investigated why is it that this test passes on darwin, but my guess is that this is because we do extra work on darwin (loading the objc runtime, etc), which causes us to enter the python interpreter sooner. This patch changes lldb.py to also initialize these values to None, as that seems to make more sense. I also fixed some typos in the test while I was in there. llvm-svn: 372222
1 parent 98c0dc3 commit fc1fd6b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

lldb/lit/Commands/Inputs/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
import lldb
2-
print("frame:py: {}".format(lldb.frame))
2+
print("frame.py: {}".format(lldb.frame))

lldb/lit/Commands/command-script-import.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
# RUN: echo 'command script import %S/Inputs/frame.py' >> %t.in
44

55
# RUN: %clang -g -O0 %S/Inputs/main.c -o %t.out
6-
# RUN: %lldb -b -s %t.in -o 'script print("script: {}").format(lldb.frame)' %t.out | FileCheck %s
6+
# RUN: %lldb -b -s %t.in -o 'script print("script: {}".format(lldb.frame))' %t.out | FileCheck %s
77

88
# Make sure that we don't have access to lldb.frame from the Python script.
9-
# CHECK: frame:py: No value
9+
# CHECK: frame.py: None
1010

1111
# Make sure that we do have access to lldb.frame from the script command.
1212
# CHECK: script: frame #0

lldb/scripts/lldb.swig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def lldb_iter(obj, getsize, getelem):
265265
debugger_unique_id = 0
266266
SBDebugger.Initialize()
267267
debugger = None
268-
target = SBTarget()
269-
process = SBProcess()
270-
thread = SBThread()
271-
frame = SBFrame()
268+
target = None
269+
process = None
270+
thread = None
271+
frame = None
272272
%}

0 commit comments

Comments
 (0)