summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/command_script/welcome.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities/command_script/welcome.py')
-rw-r--r--lldb/test/functionalities/command_script/welcome.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/lldb/test/functionalities/command_script/welcome.py b/lldb/test/functionalities/command_script/welcome.py
index 90bd0b8f7a9..c6d4ddcfd40 100644
--- a/lldb/test/functionalities/command_script/welcome.py
+++ b/lldb/test/functionalities/command_script/welcome.py
@@ -1,4 +1,4 @@
-import sys
+import lldb, sys
class WelcomeCommand(object):
def __init__(self, debugger, session_dict):
@@ -11,12 +11,19 @@ class WelcomeCommand(object):
print >>result, ('Hello ' + args + ', welcome to LLDB');
return None;
-def target_name_impl(debugger, args, result, dict):
- target = debugger.GetSelectedTarget()
- file = target.GetExecutable()
- print >>result, ('Current target ' + file.GetFilename())
- if args == 'fail':
- result.SetError('a test for error in command')
+class TargetnameCommand(object):
+ def __init__(self, debugger, session_dict):
+ pass
+
+ def __call__(self, debugger, args, exe_ctx, result):
+ target = debugger.GetSelectedTarget()
+ file = target.GetExecutable()
+ print >>result, ('Current target ' + file.GetFilename())
+ if args == 'fail':
+ result.SetError('a test for error in command')
+
+ def get_flags(self):
+ return lldb.eCommandRequiresTarget
def print_wait_impl(debugger, args, result, dict):
result.SetImmediateOutputFile(sys.stdout)
OpenPOWER on IntegriCloud