Browse Source

If can not get managed version of executable, just use the default.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2806 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
6ac96e839d
  1. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -136,8 +136,8 @@ namespace ICSharpCode.SharpDevelop.Services
string version = debugger.GetProgramVersion(processStartInfo.FileName); string version = debugger.GetProgramVersion(processStartInfo.FileName);
if (version.StartsWith("v1.0")) { if (version.StartsWith("v1.0")) {
MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.Net10NotSupported}"); MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.Net10NotSupported}");
} else if (version == null || version.Length == 0) { //} else if (string.IsNullOrEmpty(version)) {
MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.BadAssembly}"); // MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.BadAssembly}");
} else { } else {
if (DebugStarting != null) if (DebugStarting != null)
DebugStarting(this, EventArgs.Empty); DebugStarting(this, EventArgs.Empty);

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -77,6 +77,7 @@ namespace Debugger
NativeMethods.GetRequestedRuntimeVersion(exeFilename, null, 0, out size); NativeMethods.GetRequestedRuntimeVersion(exeFilename, null, 0, out size);
StringBuilder sb = new StringBuilder(size); StringBuilder sb = new StringBuilder(size);
NativeMethods.GetRequestedRuntimeVersion(exeFilename, sb, sb.Capacity, out size); NativeMethods.GetRequestedRuntimeVersion(exeFilename, sb, sb.Capacity, out size);
sb.Length = size; // TODO: What is the last char? What is the result for unmanaged apps?
return sb.ToString(); return sb.ToString();
} }
@ -87,13 +88,12 @@ namespace Debugger
/// If null, the version of the executing process will be used</param> /// If null, the version of the executing process will be used</param>
internal void InitDebugger(string debuggeeVersion) internal void InitDebugger(string debuggeeVersion)
{ {
if (debuggeeVersion != null && debuggeeVersion.Length > 1) { if (string.IsNullOrEmpty(debuggeeVersion)) {
this.debuggeeVersion = debuggeeVersion; debuggeeVersion = GetDebuggerVersion();
} else {
this.debuggeeVersion = GetDebuggerVersion();
} }
this.debuggeeVersion = debuggeeVersion;
corDebug = new ICorDebug(NativeMethods.CreateDebuggingInterfaceFromVersion(3, this.debuggeeVersion)); corDebug = new ICorDebug(NativeMethods.CreateDebuggingInterfaceFromVersion(3, debuggeeVersion));
managedCallbackSwitch = new ManagedCallbackSwitch(this); managedCallbackSwitch = new ManagedCallbackSwitch(this);
managedCallbackProxy = new ManagedCallbackProxy(this, managedCallbackSwitch); managedCallbackProxy = new ManagedCallbackProxy(this, managedCallbackSwitch);

Loading…
Cancel
Save