@@ -14,7 +14,7 @@ def test_shared_ptr_variables(self):
1414 """Test `frame variable` output for `std::shared_ptr` types."""
1515 self .build ()
1616
17- lldbutil .run_to_source_breakpoint (
17+ ( _ , process , _ , bkpt ) = lldbutil .run_to_source_breakpoint (
1818 self , "// break here" , lldb .SBFileSpec ("main.cpp" )
1919 )
2020
@@ -37,23 +37,23 @@ def test_shared_ptr_variables(self):
3737 type = "std::shared_ptr<int>" ,
3838 children = [ValueCheck (name = "__ptr_" )],
3939 )
40- self .assertRegex (valobj .summary , r"^10( strong=1)? weak=1 $" )
40+ self .assertRegex (valobj .summary , r"^10( strong=1)? weak=0 $" )
4141 self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
4242
4343 valobj = self .expect_var_path (
4444 "sp_int_ref" ,
4545 type = "std::shared_ptr<int> &" ,
4646 children = [ValueCheck (name = "__ptr_" )],
4747 )
48- self .assertRegex (valobj .summary , r"^10( strong=1)? weak=1 $" )
48+ self .assertRegex (valobj .summary , r"^10( strong=1)? weak=0 $" )
4949 self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
5050
5151 valobj = self .expect_var_path (
5252 "sp_int_ref_ref" ,
5353 type = "std::shared_ptr<int> &&" ,
5454 children = [ValueCheck (name = "__ptr_" )],
5555 )
56- self .assertRegex (valobj .summary , r"^10( strong=1)? weak=1 $" )
56+ self .assertRegex (valobj .summary , r"^10( strong=1)? weak=0 $" )
5757 self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
5858
5959 if self .expectedCompiler (["clang" ]) and self .expectedCompilerVersion (
@@ -68,12 +68,12 @@ def test_shared_ptr_variables(self):
6868 type = "std::shared_ptr<" + string_type + ">" ,
6969 children = [ValueCheck (name = "__ptr_" , summary = '"hello"' )],
7070 )
71- self .assertRegex (valobj .summary , r'^"hello"( strong=1)? weak=1 $' )
71+ self .assertRegex (valobj .summary , r'^"hello"( strong=1)? weak=0 $' )
7272
7373 valobj = self .expect_var_path ("sp_user" , type = "std::shared_ptr<User>" )
7474 self .assertRegex (
7575 valobj .summary ,
76- "^std(::__[^:]*)?::shared_ptr<User>::element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=1 " ,
76+ "^std(::__[^:]*)?::shared_ptr<User>::element_type @ 0x0*[1-9a-f][0-9a-f]+( strong=1)? weak=0 " ,
7777 )
7878 self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
7979
@@ -91,9 +91,21 @@ def test_shared_ptr_variables(self):
9191 self .expect_var_path ("sp_user->name" , type = "std::string" , summary = '"steph"' )
9292
9393 valobj = self .expect_var_path (
94- "si" , type = "std::shared_ptr<int>" , summary = "47 strong=2 weak=1 "
94+ "si" , type = "std::shared_ptr<int>" , summary = "47 strong=2 weak=0 "
9595 )
9696
9797 valobj = self .expect_var_path (
98- "sie" , type = "std::shared_ptr<int>" , summary = "nullptr strong=2 weak=1"
98+ "sie" , type = "std::shared_ptr<int>" , summary = "nullptr strong=2 weak=0"
99+ )
100+
101+ lldbutil .continue_to_breakpoint (process , bkpt )
102+
103+ valobj = self .expect_var_path (
104+ "si" , type = "std::shared_ptr<int>" , summary = "47 strong=2 weak=2"
105+ )
106+ valobj = self .expect_var_path (
107+ "sie" , type = "std::shared_ptr<int>" , summary = "nullptr strong=2 weak=2"
108+ )
109+ valobj = self .expect_var_path (
110+ "wie" , type = "std::weak_ptr<int>" , summary = "nullptr strong=2 weak=2"
99111 )
0 commit comments