[Lldb-commits] [lldb] r238425 - Fix TestCommandScript: return an error if target executable is not set

Enrico Granata egranata at apple.com
Thu May 28 08:57:28 PDT 2015


Please do not do this.

This is meant to test that LLDB automatically does the check for you via setting the eCommandRequiresTarget flag.

If that flag is not working on FreeBSD, that is what you want to look into, not just undo the entire point of that test.

My first guess is that something is going on with your build process (not recreating the SWIG layer maybe?) so I would first try a clean build.

Feel free to ask additional questions as needed, I will gladly help.

But as I said, please revert this change and let's get the right thing tested and working.

Sent from my iPhone

> On May 28, 2015, at 7:22 AM, Ed Maste <emaste at freebsd.org> wrote:
> 
> 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
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list