Browse Source

Bugfixes - Local variables on thread without symbols; Can't click on function without symbols; Added CurrentFunction to NDebugger

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@257 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
fb0252d6f5
  1. 9
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
  2. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  3. 48
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  4. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  5. 25
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/NDebugger-Processes.cs
  6. 16
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/NDebugger-Threads.cs
  7. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

9
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs

@ -86,8 +86,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -86,8 +86,11 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
void CallStackListItemActivate(object sender, EventArgs e)
{
if (debuggerCore.IsCurrentProcessSafeForInspection) {
debuggerCore.CurrentThread.CurrentFunction = (Function)(callStackList.SelectedItems[0].Tag);
if (debuggerCore.IsCurrentThreadSafeForInspection) {
Function f = (Function)(callStackList.SelectedItems[0].Tag);
if (f.HasSymbols) {
debuggerCore.CurrentFunction = f;
}
}
}
@ -105,7 +108,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -105,7 +108,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
callStackList.BeginUpdate();
callStackList.Items.Clear();
if (debuggerCore.IsCurrentProcessSafeForInspection) {
if (debuggerCore.IsCurrentThreadSafeForInspection) {
foreach (Function f in debuggerCore.CurrentThread.Callstack) {
ListViewItem item = new ListViewItem(new string[] { f.Name, "" });
item.Tag = f;

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

@ -384,6 +384,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -384,6 +384,7 @@ namespace ICSharpCode.SharpDevelop.Services
{
SourcecodeSegment nextStatement = debugger.NextStatement;
if (nextStatement == null) {
DebuggerService.RemoveCurrentLineMarker();
return;
}
DebuggerService.JumpToCurrentLine(nextStatement.SourceFullFilename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn);

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

@ -184,50 +184,44 @@ namespace DebuggerLibrary @@ -184,50 +184,44 @@ namespace DebuggerLibrary
Process process = Process.CreateProcess(this, filename, workingDirectory, arguments);
AddProcess(process);
}
public bool IsCurrentProcessSafeForInspection {
public Function CurrentFunction {
get {
if (CurrentProcess == null) {
return false;
if (IsCurrentThreadSafeForInspection) {
return CurrentThread.CurrentFunction;
} else {
return CurrentProcess.IsProcessSafeForInspection;
return null;
}
}
}
internal void CheckThatCurrentProcessIsSafeForInspection()
{
if (CurrentProcess == null) {
throw new DebuggerException("There is no process being debugged.");
} else {
CurrentProcess.CheckThatProcessIsSafeForInspection();
set {
if (IsCurrentThreadSafeForInspection) {
CurrentThread.CurrentFunction = value;
}
}
}
public Thread CurrentThread {
public bool IsCurrentFunctionSafeForInspection {
get {
if (CurrentProcess == null) return null;
return CurrentProcess.CurrentThread;
}
set {
CurrentProcess.CurrentThread = value;
if (IsCurrentThreadSafeForInspection &&
CurrentThread.CurrentFunction != null &&
CurrentThread.CurrentFunction.HasSymbols) {
return true;
} else {
return false;
}
}
}
public SourcecodeSegment NextStatement {
get {
if (!IsCurrentProcessSafeForInspection) return null;
if (CurrentProcess.CurrentThread.CurrentFunction == null) {
return null;
} else {
return CurrentProcess.CurrentThread.CurrentFunction.NextStatement;
}
if (!IsCurrentFunctionSafeForInspection) return null;
return CurrentProcess.CurrentThread.CurrentFunction.NextStatement;
}
}
public VariableCollection LocalVariables {
get {
if (!IsCurrentProcessSafeForInspection) return VariableCollection.Empty;
if (!IsCurrentFunctionSafeForInspection) return VariableCollection.Empty;
return CurrentProcess.CurrentThread.CurrentFunction.GetVariables();
}
}

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

@ -44,6 +44,12 @@ namespace DebuggerLibrary @@ -44,6 +44,12 @@ namespace DebuggerLibrary
return methodProps.IsStatic;
}
}
public bool HasSymbols {
get {
return module.SymbolsLoaded;
}
}
internal ICorDebugClass ContaingClass {
get {

25
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/NDebugger-Processes.cs

@ -20,6 +20,12 @@ namespace DebuggerLibrary @@ -20,6 +20,12 @@ namespace DebuggerLibrary
public event EventHandler<ProcessEventArgs> ProcessStarted;
public event EventHandler<ProcessEventArgs> ProcessExited;
public IList<Process> Processes {
get {
return processCollection.AsReadOnly();
}
}
public Process CurrentProcess {
get {
@ -32,10 +38,23 @@ namespace DebuggerLibrary @@ -32,10 +38,23 @@ namespace DebuggerLibrary
currentProcess = value;
}
}
public IList<Process> Processes {
public bool IsCurrentProcessSafeForInspection {
get {
return processCollection.AsReadOnly();
if (CurrentProcess == null) {
return false;
} else {
return CurrentProcess.IsProcessSafeForInspection;
}
}
}
internal void CheckThatCurrentProcessIsSafeForInspection()
{
if (CurrentProcess == null) {
throw new DebuggerException("There is no process being debugged.");
} else {
CurrentProcess.CheckThatProcessIsSafeForInspection();
}
}

16
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/NDebugger-Threads.cs

@ -46,6 +46,22 @@ namespace DebuggerLibrary @@ -46,6 +46,22 @@ namespace DebuggerLibrary
return threadCollection.AsReadOnly();
}
}
public Thread CurrentThread {
get {
if (CurrentProcess == null) return null;
return CurrentProcess.CurrentThread;
}
set {
CurrentProcess.CurrentThread = value;
}
}
public bool IsCurrentThreadSafeForInspection {
get {
return IsCurrentProcessSafeForInspection;
}
}
internal Thread GetThread(ICorDebugThread corThread)
{

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

@ -232,14 +232,16 @@ namespace DebuggerLibrary @@ -232,14 +232,16 @@ namespace DebuggerLibrary
if (currentFunction == null) {
currentFunction = LastFunctionWithLoadedSymbols;
}
if (currentFunction == null) {
currentFunction = LastFunction;
}
return currentFunction;
}
set {
if (value != null && !value.HasSymbols) {
throw new DebuggerException("CurrentFunction must have symbols");
}
currentFunction = value;
if (debugger.ManagedCallback.HandlingCallback == false) {
debugger.OnDebuggingPaused(PausedReason.CurrentFunctionChanged);
}
@ -249,7 +251,7 @@ namespace DebuggerLibrary @@ -249,7 +251,7 @@ namespace DebuggerLibrary
public Function LastFunctionWithLoadedSymbols {
get {
foreach (Function function in Callstack) {
if (function.Module.SymbolsLoaded) {
if (function.HasSymbols) {
return function;
}
}

Loading…
Cancel
Save