@@ -14,7 +14,7 @@ def test_shared_ptr_variables(self):
14
14
"""Test `frame variable` output for `std::shared_ptr` types."""
15
15
self .build ()
16
16
17
- lldbutil .run_to_source_breakpoint (
17
+ ( _ , process , _ , bkpt ) = lldbutil .run_to_source_breakpoint (
18
18
self , "// break here" , lldb .SBFileSpec ("main.cpp" )
19
19
)
20
20
@@ -37,23 +37,23 @@ def test_shared_ptr_variables(self):
37
37
type = "std::shared_ptr<int>" ,
38
38
children = [ValueCheck (name = "__ptr_" )],
39
39
)
40
- self .assertRegex (valobj .summary , r"^10( strong=1)? weak=1 $" )
40
+ self .assertRegex (valobj .summary , r"^10( strong=1)? weak=0 $" )
41
41
self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
42
42
43
43
valobj = self .expect_var_path (
44
44
"sp_int_ref" ,
45
45
type = "std::shared_ptr<int> &" ,
46
46
children = [ValueCheck (name = "__ptr_" )],
47
47
)
48
- self .assertRegex (valobj .summary , r"^10( strong=1)? weak=1 $" )
48
+ self .assertRegex (valobj .summary , r"^10( strong=1)? weak=0 $" )
49
49
self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
50
50
51
51
valobj = self .expect_var_path (
52
52
"sp_int_ref_ref" ,
53
53
type = "std::shared_ptr<int> &&" ,
54
54
children = [ValueCheck (name = "__ptr_" )],
55
55
)
56
- self .assertRegex (valobj .summary , r"^10( strong=1)? weak=1 $" )
56
+ self .assertRegex (valobj .summary , r"^10( strong=1)? weak=0 $" )
57
57
self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
58
58
59
59
if self .expectedCompiler (["clang" ]) and self .expectedCompilerVersion (
@@ -68,12 +68,12 @@ def test_shared_ptr_variables(self):
68
68
type = "std::shared_ptr<" + string_type + ">" ,
69
69
children = [ValueCheck (name = "__ptr_" , summary = '"hello"' )],
70
70
)
71
- self .assertRegex (valobj .summary , r'^"hello"( strong=1)? weak=1 $' )
71
+ self .assertRegex (valobj .summary , r'^"hello"( strong=1)? weak=0 $' )
72
72
73
73
valobj = self .expect_var_path ("sp_user" , type = "std::shared_ptr<User>" )
74
74
self .assertRegex (
75
75
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 " ,
77
77
)
78
78
self .assertNotEqual (valobj .child [0 ].unsigned , 0 )
79
79
@@ -91,11 +91,23 @@ def test_shared_ptr_variables(self):
91
91
self .expect_var_path ("sp_user->name" , type = "std::string" , summary = '"steph"' )
92
92
93
93
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 "
95
95
)
96
96
97
97
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"
99
111
)
100
112
101
113
self .runCmd ("settings set target.experimental.use-DIL true" )
0 commit comments