[mcs] Show correct #line location for files in other than current location referenced...
authorMarek Safar <marek.safar@gmail.com>
Mon, 9 Dec 2013 13:37:47 +0000 (14:37 +0100)
committerMarek Safar <marek.safar@gmail.com>
Mon, 9 Dec 2013 13:37:47 +0000 (14:37 +0100)
mcs/mcs/context.cs

index 091141eec033363892b9f9a10909c108796d2685..5ab84f260afd3ae85e8d9c6ee75f1e70c1582a97 100644 (file)
@@ -615,8 +615,12 @@ namespace Mono.CSharp
 
                        string path;
                        if (!Path.IsPathRooted (name)) {
-                               string root = Path.GetDirectoryName (comp_unit.SourceFile.FullPathName);
+                               var loc = comp_unit.SourceFile;
+                               string root = Path.GetDirectoryName (loc.FullPathName);
                                path = Path.GetFullPath (Path.Combine (root, name));
+                               var dir = Path.GetDirectoryName (loc.Name);
+                               if (!string.IsNullOrEmpty (dir))
+                                       name = Path.Combine (dir, name);
                        } else
                                path = name;