Browse Source

Fixed Forum-4952,5005 - Ignored errors when manipulating pdb files

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1104 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
5a8919099a
  1. 32
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs

32
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs

@ -144,15 +144,21 @@ namespace Debugger
fullPath = Marshal.PtrToStringUni(pString); fullPath = Marshal.PtrToStringUni(pString);
Marshal.FreeHGlobal(pString); Marshal.FreeHGlobal(pString);
string tempPath = Path.Combine(Path.GetTempPath(), Path.Combine("DebeggerPdb", new Random().Next().ToString())); string tempPath = String.Empty;
string pdbFilename = Path.GetFileNameWithoutExtension(FullPath) + ".pdb"; string pdbFilename = String.Empty;
string oldPdbPath = Path.Combine(Path.GetDirectoryName(FullPath), pdbFilename); string oldPdbPath = String.Empty;
string newPdbPath = Path.Combine(tempPath, pdbFilename); string newPdbPath = String.Empty;
if (File.Exists(oldPdbPath)) { try {
Directory.CreateDirectory(tempPath); tempPath = Path.Combine(Path.GetTempPath(), Path.Combine("DebeggerPdb", new Random().Next().ToString()));
File.Move(oldPdbPath, newPdbPath); pdbFilename = Path.GetFileNameWithoutExtension(FullPath) + ".pdb";
} oldPdbPath = Path.Combine(Path.GetDirectoryName(FullPath), pdbFilename);
fullPathPDB = newPdbPath; newPdbPath = Path.Combine(tempPath, pdbFilename);
if (File.Exists(oldPdbPath)) {
Directory.CreateDirectory(tempPath);
File.Move(oldPdbPath, newPdbPath);
}
fullPathPDB = newPdbPath;
} catch {}
SymBinder symBinder = new SymBinder(); SymBinder symBinder = new SymBinder();
IntPtr ptr = IntPtr.Zero; IntPtr ptr = IntPtr.Zero;
@ -167,9 +173,11 @@ namespace Debugger
} }
} }
if (File.Exists(newPdbPath)) { try {
File.Copy(newPdbPath, oldPdbPath); if (File.Exists(newPdbPath) && !File.Exists(oldPdbPath)) {
} File.Copy(newPdbPath, oldPdbPath);
}
} catch {}
JMCStatus = SymbolsLoaded; JMCStatus = SymbolsLoaded;
} }

Loading…
Cancel
Save