summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-09-18 12:58:52 +0000
committerPavel Labath <pavel@labath.sk>2019-09-18 12:58:52 +0000
commitfc1fd6bf9fcfac412b10b4193805ec5de0e8df57 (patch)
tree459bb06845105b587daea61164b78ebf8c790f60
parent98c0dc39de24d85e3d7dca488babff952f35578c (diff)
downloadbcm5719-llvm-fc1fd6bf9fcfac412b10b4193805ec5de0e8df57.tar.gz
bcm5719-llvm-fc1fd6bf9fcfac412b10b4193805ec5de0e8df57.zip
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
-rw-r--r--lldb/lit/Commands/Inputs/frame.py2
-rw-r--r--lldb/lit/Commands/command-script-import.test4
-rw-r--r--lldb/scripts/lldb.swig8
3 files changed, 7 insertions, 7 deletions
diff --git a/lldb/lit/Commands/Inputs/frame.py b/lldb/lit/Commands/Inputs/frame.py
index 07ed2d42aa4..40591742839 100644
--- a/lldb/lit/Commands/Inputs/frame.py
+++ b/lldb/lit/Commands/Inputs/frame.py
@@ -1,2 +1,2 @@
import lldb
-print("frame:py: {}".format(lldb.frame))
+print("frame.py: {}".format(lldb.frame))
diff --git a/lldb/lit/Commands/command-script-import.test b/lldb/lit/Commands/command-script-import.test
index 6034a67fe3a..6a8e8176f24 100644
--- a/lldb/lit/Commands/command-script-import.test
+++ b/lldb/lit/Commands/command-script-import.test
@@ -3,10 +3,10 @@
# RUN: echo 'command script import %S/Inputs/frame.py' >> %t.in
# RUN: %clang -g -O0 %S/Inputs/main.c -o %t.out
-# RUN: %lldb -b -s %t.in -o 'script print("script: {}").format(lldb.frame)' %t.out | FileCheck %s
+# RUN: %lldb -b -s %t.in -o 'script print("script: {}".format(lldb.frame))' %t.out | FileCheck %s
# Make sure that we don't have access to lldb.frame from the Python script.
-# CHECK: frame:py: No value
+# CHECK: frame.py: None
# Make sure that we do have access to lldb.frame from the script command.
# CHECK: script: frame #0
diff --git a/lldb/scripts/lldb.swig b/lldb/scripts/lldb.swig
index 3cad53ad762..ec39ad1b335 100644
--- a/lldb/scripts/lldb.swig
+++ b/lldb/scripts/lldb.swig
@@ -265,8 +265,8 @@ def lldb_iter(obj, getsize, getelem):
debugger_unique_id = 0
SBDebugger.Initialize()
debugger = None
-target = SBTarget()
-process = SBProcess()
-thread = SBThread()
-frame = SBFrame()
+target = None
+process = None
+thread = None
+frame = None
%}
OpenPOWER on IntegriCloud