Browse Source

Bugfixes - no CurrentFunction in Threads pad handled, Method signature blob ignored now, dereference fail handled

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@253 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
95c177bd75
  1. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs
  2. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/MetaData/MetaData.cs
  3. 14
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs
  4. 7
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Variable.cs

8
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs

@ -121,9 +121,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
item.Text = e.Thread.ID.ToString(); item.Text = e.Thread.ID.ToString();
item.Tag = e.Thread; item.Tag = e.Thread;
item.SubItems.Add(e.Thread.Name); item.SubItems.Add(e.Thread.Name);
Function location = e.Thread.LastFunctionWithLoadedSymbols; Function location;
location = e.Thread.LastFunctionWithLoadedSymbols;
if (location == null) {
location = e.Thread.LastFunction;
}
if (location != null) { if (location != null) {
item.SubItems.Add(e.Thread.CurrentFunction.Name); item.SubItems.Add(location.Name);
} else { } else {
item.SubItems.Add("N/A"); item.SubItems.Add("N/A");
} }

11
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/MetaData/MetaData.cs

@ -175,7 +175,7 @@ namespace DebuggerLibrary
uint pStringLenght = 0; // Terminating character included in pStringLenght uint pStringLenght = 0; // Terminating character included in pStringLenght
IntPtr pString = IntPtr.Zero; IntPtr pString = IntPtr.Zero;
IntPtr pSigBlob; //IntPtr pSigBlob;
uint sigBlobSize; uint sigBlobSize;
metaData.GetMethodProps(methodProps.Token, metaData.GetMethodProps(methodProps.Token,
out methodProps.ClassToken, out methodProps.ClassToken,
@ -183,7 +183,7 @@ namespace DebuggerLibrary
pStringLenght, pStringLenght,
out pStringLenght, // real string lenght out pStringLenght, // real string lenght
out methodProps.Flags, out methodProps.Flags,
new IntPtr(&pSigBlob), IntPtr.Zero,//new IntPtr(&pSigBlob),
out sigBlobSize, out sigBlobSize,
out methodProps.CodeRVA, out methodProps.CodeRVA,
out methodProps.ImplFlags); out methodProps.ImplFlags);
@ -197,7 +197,7 @@ namespace DebuggerLibrary
pStringLenght, pStringLenght,
out pStringLenght, // real string lenght out pStringLenght, // real string lenght
out methodProps.Flags, out methodProps.Flags,
new IntPtr(&pSigBlob), IntPtr.Zero,//new IntPtr(&pSigBlob),
out sigBlobSize, out sigBlobSize,
out methodProps.CodeRVA, out methodProps.CodeRVA,
out methodProps.ImplFlags); out methodProps.ImplFlags);
@ -205,9 +205,10 @@ namespace DebuggerLibrary
methodProps.Name = Marshal.PtrToStringUni(pString); methodProps.Name = Marshal.PtrToStringUni(pString);
Marshal.FreeHGlobal(pString); Marshal.FreeHGlobal(pString);
methodProps.Signature = new SignatureStream(pSigBlob, sigBlobSize); methodProps.Signature = null;
//methodProps.Signature = new SignatureStream(pSigBlob, sigBlobSize);
Marshal.FreeCoTaskMem(pSigBlob); //Marshal.FreeCoTaskMem(pSigBlob);
return methodProps; return methodProps;
} }

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

@ -226,6 +226,13 @@ namespace DebuggerLibrary
public Function CurrentFunction { public Function CurrentFunction {
get { get {
process.CheckThatProcessIsSafeForInspection(); process.CheckThatProcessIsSafeForInspection();
if (currentFunction == null) {
currentFunction = LastFunctionWithLoadedSymbols;
}
if (currentFunction == null) {
currentFunction = LastFunction;
}
return currentFunction; return currentFunction;
} }
@ -250,7 +257,12 @@ namespace DebuggerLibrary
public Function LastFunction { public Function LastFunction {
get { get {
return Callstack[0]; List<Function> callstack = Callstack;
if (callstack.Count > 0) {
return Callstack[0];
} else {
return null;
}
} }
} }
} }

7
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Variable.cs

@ -136,7 +136,12 @@ namespace DebuggerLibrary
((ICorDebugReferenceValue)corValue).IsNull(out isNull); ((ICorDebugReferenceValue)corValue).IsNull(out isNull);
if (isNull == 0) { if (isNull == 0) {
ICorDebugValue dereferencedValue; ICorDebugValue dereferencedValue;
((ICorDebugReferenceValue)corValue).Dereference(out dereferencedValue); try {
((ICorDebugReferenceValue)corValue).Dereference(out dereferencedValue);
} catch {
// Error during dereferencing
return null;
}
return DereferenceUnbox(dereferencedValue); // Try again return DereferenceUnbox(dereferencedValue); // Try again
} else { } else {
return null; return null;

Loading…
Cancel
Save