Files
clang-p2996/lldb/test/functionalities/command_script/welcome.py
Enrico Granata 0a305db796 this patch addresses several issues with "command script" subcommands:
a) adds a new --synchronicity (-s) setting for "command script add" that allows the user to decide if scripted commands should run synchronously or asynchronously (which can make a difference in how events are handled)
 b) clears up several error messages
 c) adds a new --allow-reload (-r) setting for "command script import" that allows the user to reload a module even if it has already been imported before
 d) allows filename completion for "command script import" (much like what happens for "target create")
 e) prevents "command script add" from replacing built-in commands with scripted commands
 f) changes AddUserCommand() to take an std::string instead of a const char* (for performance reasons)
plus, it fixes an issue in "type summary add" command handling which caused several test suite errors

llvm-svn: 144035
2011-11-07 22:57:04 +00:00

35 lines
1.0 KiB
Python

import sys
def welcome_impl(debugger, args, result, dict):
"""
Just a docstring for welcome_impl
A command that says hello to LLDB users
"""
result.Printf('Hello ' + args + ', welcome to LLDB');
return None;
def target_name_impl(debugger, args, result, dict):
target = debugger.GetSelectedTarget()
file = target.GetExecutable()
result.PutCString('Current target ' + file.GetFilename())
if args == 'fail':
return 'a test for error in command'
else:
return None
def print_wait_impl(debugger, args, result, dict):
print 'Trying to do long task..';
import time
time.sleep(1)
print 'Still doing long task..';
time.sleep(1)
result.PutCString('Done; if you saw the delays I am doing OK')
return None
def check_for_synchro(debugger, args, result, dict):
if debugger.GetAsync() == True:
result.PutCString('I am running async')
if debugger.GetAsync() == False:
result.PutCString('I am running sync')
return None