[Lldb-commits] [lldb] r238425 - Fix TestCommandScript: return an error if target executable is not set
Ed Maste
emaste at freebsd.org
Thu May 28 07:22:57 PDT 2015
Author: emaste
Date: Thu May 28 09:22:57 2015
New Revision: 238425
URL: http://llvm.org/viewvc/llvm-project?rev=238425&view=rev
Log:
Fix TestCommandScript: return an error if target executable is not set
The test invokes the 'targetname' test command before setting a
target executable, which caused Python to raise TypeError: cannot
concatenate 'str' and 'NoneType' objects.
llvm.org/pr23686
Modified:
lldb/trunk/test/functionalities/command_script/welcome.py
Modified: lldb/trunk/test/functionalities/command_script/welcome.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_script/welcome.py?rev=238425&r1=238424&r2=238425&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/command_script/welcome.py (original)
+++ lldb/trunk/test/functionalities/command_script/welcome.py Thu May 28 09:22:57 2015
@@ -16,11 +16,15 @@ class TargetnameCommand(object):
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')
+ return
+ target = debugger.GetSelectedTarget()
+ file = target.GetExecutable()
+ if file:
+ print >>result, ('Current target ' + file.GetFilename())
+ else:
+ result.SetError('target.GetExecutable() failed')
def get_flags(self):
return lldb.eCommandRequiresTarget
More information about the lldb-commits
mailing list