summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/command_script
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities/command_script')
-rw-r--r--lldb/test/functionalities/command_script/TestCommandScript.py4
-rw-r--r--lldb/test/functionalities/command_script/py_import1
-rw-r--r--lldb/test/functionalities/command_script/welcome.py3
3 files changed, 8 insertions, 0 deletions
diff --git a/lldb/test/functionalities/command_script/TestCommandScript.py b/lldb/test/functionalities/command_script/TestCommandScript.py
index 6efda1c46aa..27ce4a7c6f1 100644
--- a/lldb/test/functionalities/command_script/TestCommandScript.py
+++ b/lldb/test/functionalities/command_script/TestCommandScript.py
@@ -40,6 +40,7 @@ class CmdPythonTestCase(TestBase):
self.runCmd('command script delete tell_async', check=False)
self.runCmd('command script delete tell_curr', check=False)
self.runCmd('command script delete bug11569', check=False)
+ self.runCmd('command script delete takes_exe_ctx', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -108,6 +109,9 @@ class CmdPythonTestCase(TestBase):
substrs = ['running async'])
self.expect("tell_curr",
substrs = ['I am running sync'])
+
+# check that the execution context is passed in to commands that ask for it
+ self.expect("takes_exe_ctx", substrs = ["a.out"])
# Test that a python command can redefine itself
self.expect('command script add -f foobar welcome -h "just some help"')
diff --git a/lldb/test/functionalities/command_script/py_import b/lldb/test/functionalities/command_script/py_import
index 8cb112d884d..afc8c82340e 100644
--- a/lldb/test/functionalities/command_script/py_import
+++ b/lldb/test/functionalities/command_script/py_import
@@ -9,3 +9,4 @@ command script import mysto.py --allow-reload
command script add tell_sync --function welcome.check_for_synchro --synchronicity sync
command script add tell_async --function welcome.check_for_synchro --synchronicity async
command script add tell_curr --function welcome.check_for_synchro --synchronicity curr
+command script add takes_exe_ctx --function welcome.takes_exe_ctx
diff --git a/lldb/test/functionalities/command_script/welcome.py b/lldb/test/functionalities/command_script/welcome.py
index b6340990e78..c444934012f 100644
--- a/lldb/test/functionalities/command_script/welcome.py
+++ b/lldb/test/functionalities/command_script/welcome.py
@@ -30,3 +30,6 @@ def check_for_synchro(debugger, args, result, dict):
if debugger.GetAsync() == False:
print >>result, ('I am running sync')
+def takes_exe_ctx(debugger, args, exe_ctx, result, dict):
+ print >>result, str(exe_ctx.GetTarget())
+
OpenPOWER on IntegriCloud