From 474f4d86c6bae91bea583da61dd6d1caaae1d287 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 23 Dec 2007 00:08:08 +0000 Subject: [PATCH] added pdb logging --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401822 --- tools/builder/Config.cs | 5 +++++ tools/builder/Main.cs | 4 ++++ tools/builder/Win32Builder.cs | 12 ++++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/builder/Config.cs b/tools/builder/Config.cs index 309fce4e..3deb61fe 100644 --- a/tools/builder/Config.cs +++ b/tools/builder/Config.cs @@ -16,6 +16,7 @@ namespace builder public string pkg_path; public string builder_path; public string build_options; + public string pdb_log_file; public builder.BasePlatform Platform; public Config() @@ -85,6 +86,10 @@ namespace builder { build_options = val; } + else if (key.CompareTo("PDBLog") == 0) + { + pdb_log_file = val; + } } } } diff --git a/tools/builder/Main.cs b/tools/builder/Main.cs index 5fb74963..e4aa6452 100644 --- a/tools/builder/Main.cs +++ b/tools/builder/Main.cs @@ -31,6 +31,10 @@ namespace builder else if (cfg.Platform == BasePlatform.Platform_Windows) { bld = new Win32Builder(cfg); + if (cfg.pdb_log_file != null && File.Exists(cfg.pdb_log_file)) + { + File.Delete(cfg.pdb_log_file); + } } try diff --git a/tools/builder/Win32Builder.cs b/tools/builder/Win32Builder.cs index eff27468..99a55426 100644 --- a/tools/builder/Win32Builder.cs +++ b/tools/builder/Win32Builder.cs @@ -101,10 +101,14 @@ namespace builder binName); File.Copy(binpath, path, true); - /* On Windows we package the .pdb files as well */ - binpath = binpath.Replace(".dll", ".pdb"); - path = path.Replace(".dll", ".pdb"); - File.Copy(binpath, path, true); + /* On Windows we optionally log the PDB path */ + if (!lib.is_executable && cfg.pdb_log_file != null) + { + FileStream fs = File.Open(cfg.pdb_log_file, FileMode.Append, FileAccess.Write); + StreamWriter sw = new StreamWriter(fs); + sw.WriteLine(binpath.Replace(".dll", ".pdb")); + sw.Close(); + } return true; }