diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 | 
| commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
| tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/tools/lldb-mi/stack | |
| parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/tools/lldb-mi/stack')
| -rw-r--r-- | packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py | 15 | ||||
| -rw-r--r-- | packages/Python/lldbsuite/test/tools/lldb-mi/stack/main.cpp | 15 | 
2 files changed, 30 insertions, 0 deletions
| diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py b/packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py index 14dab38bb338..54ed91951333 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py @@ -7,7 +7,9 @@ from __future__ import print_function  import lldbmi_testcase +from lldbsuite.test.decorators import *  from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil  class MiStackTestCase(lldbmi_testcase.MiTestCaseBase): @@ -199,7 +201,20 @@ class MiStackTestCase(lldbmi_testcase.MiTestCaseBase):          self.expect("\^done,locals=\[{name=\"test_str\",type=\"const char \*\",value=\".*?Rakaposhi.*?\"},{name=\"var_e\",type=\"int\",value=\"24\"},{name=\"ptr\",type=\"int \*\",value=\".*?\"}\]")          self.runCmd("-stack-list-locals --simple-values")          self.expect("\^done,locals=\[{name=\"test_str\",type=\"const char \*\",value=\".*?Rakaposhi.*?\"},{name=\"var_e\",type=\"int\",value=\"24\"},{name=\"ptr\",type=\"int \*\",value=\".*?\"}\]") +         +        # Test -stack-list-locals in a function with catch clause,  +        # having unnamed parameter +        # Run to BP_catch_unnamed +        line = line_number('main.cpp', '// BP_catch_unnamed') +        self.runCmd("-break-insert --file main.cpp:%d" % line) +        self.expect("\^done,bkpt={number=\"6\"") +        self.runCmd("-exec-continue") +        self.expect("\^running") +        self.expect("\*stopped,reason=\"breakpoint-hit\"") +        # Test -stack-list-locals: use --no-values +        self.runCmd("-stack-list-locals --no-values") +        self.expect("\^done,locals=\[name=\"i\",name=\"j\"\]")      @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows      @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races      def test_lldbmi_stack_list_variables(self): diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/stack/main.cpp b/packages/Python/lldbsuite/test/tools/lldb-mi/stack/main.cpp index e11f83e108ec..32db32d2fd16 100644 --- a/packages/Python/lldbsuite/test/tools/lldb-mi/stack/main.cpp +++ b/packages/Python/lldbsuite/test/tools/lldb-mi/stack/main.cpp @@ -7,6 +7,8 @@  //  //===----------------------------------------------------------------------===// +#include <exception> +  struct inner  {      int var_d; @@ -114,6 +116,18 @@ int do_tests_with_args()      return 0;  } +void catch_unnamed_test() +{ +    try +    { +        int i = 1, j = 2; +        throw std::exception(); // BP_catch_unnamed +    } +    catch(std::exception&) +    { +    } +} +  int  main(int argc, char const *argv[])  { @@ -121,6 +135,7 @@ main(int argc, char const *argv[])      local_struct_test();      local_array_test();      local_pointer_test(); +    catch_unnamed_test();      do_tests_with_args();      return 0; | 
