added pdb logging
authorDavid Anderson <dvander@alliedmods.net>
Sun Dec 23 00:08:08 2007 +0000 (2007-12-23)
changeset 1816269bbfbfbcac
parent 1815 b0de032adc8f
child 1817 debf84ea93df
added pdb logging
tools/builder/Config.cs
tools/builder/Main.cs
tools/builder/Win32Builder.cs
     1.1 --- a/tools/builder/Config.cs	Sat Dec 22 19:36:28 2007 +0000
     1.2 +++ b/tools/builder/Config.cs	Sun Dec 23 00:08:08 2007 +0000
     1.3 @@ -16,6 +16,7 @@
     1.4  		public string pkg_path;
     1.5  		public string builder_path;
     1.6  		public string build_options;
     1.7 +		public string pdb_log_file;
     1.8  		public builder.BasePlatform Platform;
     1.9  
    1.10  		public Config()
    1.11 @@ -85,6 +86,10 @@
    1.12  						{
    1.13  							build_options = val;
    1.14  						}
    1.15 +						else if (key.CompareTo("PDBLog") == 0)
    1.16 +						{
    1.17 +							pdb_log_file = val;
    1.18 +						}
    1.19  					}
    1.20  				}
    1.21  			} 
     2.1 --- a/tools/builder/Main.cs	Sat Dec 22 19:36:28 2007 +0000
     2.2 +++ b/tools/builder/Main.cs	Sun Dec 23 00:08:08 2007 +0000
     2.3 @@ -31,6 +31,10 @@
     2.4  			else if (cfg.Platform == BasePlatform.Platform_Windows)
     2.5  			{
     2.6  				bld = new Win32Builder(cfg);
     2.7 +				if (cfg.pdb_log_file != null && File.Exists(cfg.pdb_log_file))
     2.8 +				{
     2.9 +					File.Delete(cfg.pdb_log_file);
    2.10 +				}
    2.11  			}
    2.12  
    2.13  			try
     3.1 --- a/tools/builder/Win32Builder.cs	Sat Dec 22 19:36:28 2007 +0000
     3.2 +++ b/tools/builder/Win32Builder.cs	Sun Dec 23 00:08:08 2007 +0000
     3.3 @@ -101,10 +101,14 @@
     3.4  				binName);
     3.5  			File.Copy(binpath, path, true);
     3.6  
     3.7 -			/* On Windows we package the .pdb files as well */
     3.8 -			binpath = binpath.Replace(".dll", ".pdb");
     3.9 -			path = path.Replace(".dll", ".pdb");
    3.10 -			File.Copy(binpath, path, true);
    3.11 +			/* On Windows we optionally log the PDB path */
    3.12 +			if (!lib.is_executable && cfg.pdb_log_file != null)
    3.13 +			{
    3.14 +				FileStream fs = File.Open(cfg.pdb_log_file, FileMode.Append, FileAccess.Write);
    3.15 +				StreamWriter sw = new StreamWriter(fs);
    3.16 +				sw.WriteLine(binpath.Replace(".dll", ".pdb"));
    3.17 +				sw.Close();
    3.18 +			}
    3.19  
    3.20  			return true;
    3.21  		}