From 1d9cb8a1844baa3ca3a8912a667364726cf3931e Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 14 Dec 2011 20:40:27 +0000 Subject: http://llvm.org/bugs/show_bug.cgi?id=11569 LLDBSwigPythonCallCommand crashes when a command script returns an object Add more robustness to LLDBSwigPythonCallCommand. It should check whether the returned Python object is a string, and only assign it as the error msg when the check holds. Also add a regression test. llvm-svn: 146584 --- lldb/test/functionalities/command_script/TestCommandScript.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lldb/test/functionalities/command_script/TestCommandScript.py') diff --git a/lldb/test/functionalities/command_script/TestCommandScript.py b/lldb/test/functionalities/command_script/TestCommandScript.py index c381e4985a9..bc20285b872 100644 --- a/lldb/test/functionalities/command_script/TestCommandScript.py +++ b/lldb/test/functionalities/command_script/TestCommandScript.py @@ -37,6 +37,7 @@ class CmdPythonTestCase(TestBase): self.runCmd('command script delete tell_sync', check=False) 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) # Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup) @@ -115,6 +116,12 @@ class CmdPythonTestCase(TestBase): self.expect('command script add -f foobar frame', error=True, substrs = ['cannot add command']) + # http://llvm.org/bugs/show_bug.cgi?id=11569 + # LLDBSwigPythonCallCommand crashes when a command script returns an object + self.runCmd('command script add -f bug11569 bug11569') + # This should not crash. + self.runCmd('bug11569', check=False) + if __name__ == '__main__': import atexit lldb.SBDebugger.Initialize() -- cgit v1.2.3