77
88
99class LocationListLookupTestCase (TestBase ):
10- @skipIf (oslist = ["linux" ], archs = ["arm" ])
11- def test_loclist (self ):
12- self .build ()
13-
10+ def launch (self ) -> lldb .SBProcess :
1411 exe = self .getBuildArtifact ("a.out" )
1512 target = self .dbg .CreateTarget (exe )
1613 self .assertTrue (target , VALID_TARGET )
@@ -22,15 +19,31 @@ def test_loclist(self):
2219 self .assertTrue (process .IsValid ())
2320 self .assertTrue (process .is_stopped )
2421
22+ return process
23+
24+ def check_local_vars (self , process : lldb .SBProcess , check_expr : bool ):
2525 # Find `bar` on the stack, then
2626 # make sure we can read out the local
2727 # variables (with both `frame var` and `expr`)
2828 for f in process .GetSelectedThread ().frames :
29- if f .GetDisplayFunctionName ().startswith ("Foo::bar" ):
29+ frame_name = f .GetDisplayFunctionName ()
30+ if frame_name is not None and frame_name .startswith ("Foo::bar" ):
3031 argv = f .GetValueForVariablePath ("argv" ).GetChildAtIndex (0 )
3132 strm = lldb .SBStream ()
3233 argv .GetDescription (strm )
3334 self .assertNotEqual (strm .GetData ().find ("a.out" ), - 1 )
3435
35- process .GetSelectedThread ().SetSelectedFrame (f .idx )
36- self .expect_expr ("this" , result_type = "Foo *" )
36+ if check_expr :
37+ process .GetSelectedThread ().SetSelectedFrame (f .idx )
38+ self .expect_expr ("this" , result_type = "Foo *" )
39+
40+ @skipIf (oslist = ["linux" ], archs = ["arm" ])
41+ @skipIfDarwin
42+ def test_loclist_frame_var (self ):
43+ self .build ()
44+ self .check_local_vars (self .launch (), check_expr = False )
45+
46+ @skipUnlessDarwin
47+ def test_loclist_expr (self ):
48+ self .build ()
49+ self .check_local_vars (self .launch (), check_expr = True )
0 commit comments