@@ -15,27 +15,29 @@ def test_source_map(self):
1515        src_path  =  os .path .join (src_dir , "main.c" )
1616        yaml_path  =  os .path .join (src_dir , "a.yaml" )
1717        yaml_base , ext  =  os .path .splitext (yaml_path )
18-         obj_path  =  self .getBuildArtifact (yaml_base )
18+         obj_path  =  self .getBuildArtifact ("main.o" )
1919        self .yaml2obj (yaml_path , obj_path )
2020
21-         def  cleanup ():
22-             if  os .path .exists (obj_path ):
23-                 os .unlink (obj_path )
24- 
25-         # Execute the cleanup function during test case tear down. 
26-         self .addTearDownHook (cleanup )
27- 
2821        # Create a target with the object file we just created from YAML 
2922        target  =  self .dbg .CreateTarget (obj_path )
3023
3124        # Set a breakpoint before we remap source and verify that it fails 
3225        bp  =  target .BreakpointCreateByLocation (src_path , 2 )
3326        self .assertTrue (bp .GetNumLocations () ==  0 ,
3427                        "make sure no breakpoints were resolved without map" )
35-         src_map_cmd  =  'settings set target.source-map ./  "%s"'  %  (src_dir )
28+         src_map_cmd  =  'settings set target.source-map . "%s"'  %  (src_dir )
3629        self .dbg .HandleCommand (src_map_cmd )
3730
3831        # Set a breakpoint after we remap source and verify that it succeeds 
3932        bp  =  target .BreakpointCreateByLocation (src_path , 2 )
4033        self .assertTrue (bp .GetNumLocations () ==  1 ,
4134                        "make sure breakpoint was resolved with map" )
35+ 
36+         # Now make sure that we can actually FIND the source file using this 
37+         # remapping: 
38+         retval  =  lldb .SBCommandReturnObject ()
39+         self .dbg .GetCommandInterpreter ().HandleCommand ("source list -f main.c -l 2" , retval )
40+         self .assertTrue (retval .Succeeded (), "source list didn't succeed." )
41+         self .assertTrue (retval .GetOutput () !=  None , "We got no ouput from source list" )
42+         self .assertTrue ("return"  in  retval .GetOutput (), "We didn't find the source file..." )
43+         
0 commit comments