Browse Source

Debugger now supports debugging IronRuby applications.

Modules pad now displays the module name instead of the module filename for dynamic modules.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5355 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Matt Ward 16 years ago
parent
commit
7139a80c40
  1. 11
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LoadedModulesPad.cs
  2. 12
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  3. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs
  4. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/SourcecodeSegment.cs

11
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LoadedModulesPad.cs

@ -150,7 +150,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
item.SubItems.Clear(); item.SubItems.Clear();
item.SubItems.AddRange( item.SubItems.AddRange(
new string[] { new string[] {
module.Filename, GetModuleFileNameOrName(module),
String.Format("{0:X8}", module.BaseAdress), String.Format("{0:X8}", module.BaseAdress),
module.DirectoryName, module.DirectoryName,
module.OrderOfLoading.ToString(), module.OrderOfLoading.ToString(),
@ -162,6 +162,15 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
); );
item.SubItems.RemoveAt(0); item.SubItems.RemoveAt(0);
} }
string GetModuleFileNameOrName(Module module)
{
string fileName = module.Filename;
if (String.IsNullOrEmpty(fileName)) {
return module.CorModule.Name;
}
return module.Filename;
}
void RemoveModule(Module module) void RemoveModule(Module module)
{ {

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

@ -722,11 +722,21 @@ namespace ICSharpCode.SharpDevelop.Services
if (debuggedProcess != null) { if (debuggedProcess != null) {
SourcecodeSegment nextStatement = debuggedProcess.NextStatement; SourcecodeSegment nextStatement = debuggedProcess.NextStatement;
if (nextStatement != null) { if (nextStatement != null) {
DebuggerService.JumpToCurrentLine(nextStatement.Filename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn); string fileName = GetFileName(nextStatement);
DebuggerService.JumpToCurrentLine(fileName, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn);
} }
} }
} }
string GetFileName(SourcecodeSegment segment)
{
string fileName = debuggedProcess.NextStatement.Filename;
if (!Path.IsPathRooted(fileName)) {
fileName = Path.Combine(debuggedProcess.WorkingDirectory, fileName);
}
return fileName;
}
StopAttachedProcessDialogResult ShowStopAttachedProcessDialog() StopAttachedProcessDialogResult ShowStopAttachedProcessDialog()
{ {
string caption = StringParser.Parse("${res:XML.MainMenu.DebugMenu.Stop}"); string caption = StringParser.Parse("${res:XML.MainMenu.DebugMenu.Stop}");

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs

@ -18,6 +18,8 @@ namespace Debugger
ICorDebugProcess corProcess; ICorDebugProcess corProcess;
ManagedCallback callbackInterface; ManagedCallback callbackInterface;
string workingDirectory = String.Empty;
#region IExpirable #region IExpirable
bool hasExited = false; bool hasExited = false;
@ -59,6 +61,10 @@ namespace Debugger
} }
} }
public string WorkingDirectory {
get { return workingDirectory; }
}
internal ManagedCallback CallbackInterface { internal ManagedCallback CallbackInterface {
get { get {
return callbackInterface; return callbackInterface;
@ -111,7 +117,9 @@ namespace Debugger
CorDebugCreateProcessFlags.DEBUG_NO_SPECIAL_OPTIONS // debuggingFlags CorDebugCreateProcessFlags.DEBUG_NO_SPECIAL_OPTIONS // debuggingFlags
); );
return new Process(debugger, outProcess); Process process = new Process(debugger, outProcess);
process.workingDirectory = workingDirectory;
return process;
} }
public string DebuggeeVersion { public string DebuggeeVersion {

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

@ -91,6 +91,16 @@ namespace Debugger
foreach(ISymUnmanagedDocument symDoc in symDocs) { foreach(ISymUnmanagedDocument symDoc in symDocs) {
if (symDoc.URL.ToLower() == filename) return symDoc; if (symDoc.URL.ToLower() == filename) return symDoc;
} }
if (module.IsDynamic) {
foreach(ISymUnmanagedDocument symDoc in symDocs) {
string url = symDoc.URL.ToLower();
if (!String.IsNullOrEmpty(url) && !Path.IsPathRooted(url)) {
string workingDir = Path.GetFullPath(module.Process.WorkingDirectory).ToLower();
url = Path.GetFullPath(Path.Combine(workingDir, url));
}
if (url == filename) return symDoc;
}
}
return null; // Not found return null; // Not found
} }

Loading…
Cancel
Save