|
Request for Debugger testing
Last post 02-13-2008 12:07 PM by hyper.space. 11 replies.
-
01-25-2008 9:44 AM
|
|
-
DavidSrbecky


- Joined on 08-22-2005
- Usti nad Labem, Czech Republic
- Posts 442

|
Request for Debugger testing
Hello everyone, For the past month I have been working on the debugger in the trunk (ie the 3.0 version). In comparison with the 2.2 version, the debugger was almost completely rewritten. It has much better support for generics now and it also should be much faster. All the major work has been finished and I am just fixing all outstanding bugs right now. If you have a spare moment, could you please download the latest 3.0 version, give the debugger a try and report any bugs you encounter to this forum. You can obtain the latest 3.0 version either from the build server or from the SVN. Thank you, David
|
|
-
-
siegi44


- Joined on 03-31-2006
- Steyr, Austria
- Posts 187

|
Re: Request for Debugger testing
Hi, I got this exception SharpDevelop Version : 3.0.0.2917 .NET Version : 2.0.50727.1433 OS Version : Microsoft Windows NT 5.1.2600 Service Pack 2 Current culture : German (Germany) (de-DE) Working Set Memory : 77240kb GC Heap Memory : 16745kb
Error while requesting tooltip for location (Line 84, Col 24) Exception thrown: System.ArgumentException: Der Wert liegt außerhalb des erwarteten Bereichs. bei Debugger.Interop.CorDebug.ICorDebugType.GetBase(ICorDebugType& pBase) bei Debugger.Wrappers.CorDebug.ICorDebugType.get_Base() bei Debugger.MetaData.DebugType.get_BaseType() bei Debugger.Value.GetMemberValue(String name) bei Debugger.Expressions.SimpleMemberReferenceExpression.EvaluateInternal(StackFrame context) bei Debugger.Expressions.Expression.Evaluate(StackFrame context) bei ICSharpCode.SharpDevelop.Services.WindowsDebugger.GetValueFromName(String variableName) bei ICSharpCode.SharpDevelop.Services.WindowsDebugger.GetValueAsString(String variableName) bei ICSharpCode.SharpDevelop.Debugging.DebuggerService.GetMemberText(IAmbience ambience, IDecoration member, String expression, Boolean& debuggerCanShowValue) bei ICSharpCode.SharpDevelop.Debugging.DebuggerService.GetText(ResolveResult result, String expression, Boolean& debuggerCanShowValue) bei ICSharpCode.SharpDevelop.Debugging.DebuggerService.GetToolTipInfo(TextArea textArea, ToolTipRequestEventArgs e) bei ICSharpCode.SharpDevelop.Debugging.DebuggerTextAreaToolTipProvider.GetToolTipInfo(TextArea textArea, ToolTipRequestEventArgs e) bei ICSharpCode.SharpDevelop.Debugging.DebuggerService.TextAreaToolTipRequest(Object sender, ToolTipRequestEventArgs e) when I had set a breakpoint on this line (85) and moved with the mouse cursor over "Length": if ((start <= array.Length - 3) && (array[0] == array[start + 1] + array[start + 2])) Here is the complete file (Console app): /* * Erstellt mit SharpDevelop. * Benutzer: Siegfried Pammer * Datum: 24.01.2008 * Zeit: 14:27 * * */ using System; using System.Collections.Generic;
namespace Test { class Program { public static void Main(String[ args) { int anzahl = 7; if (anzahl > 1) { int[ elements = new int[anzahl]; elements[0] = anzahl; List<int[> list = new List<int[>(); list.Add((int[)elements.Clone()); while (elements[0] - 1 >= elements[1] + 1) { elements[0]--; elements[1]++; list.Add((int[)elements.Clone()); for (int i = 1; i < elements.Length - 1; i++) { if ((elements[i] > 1) && (elements[i + 1] < elements[i])) { elements[i]--; elements[i + 1]++; if (!(elements[i] < elements[i + 1])) { list.Add((int[)elements.Clone()); SumUp((int[)elements.Clone(), list); } } } } for (int i = 0; i < elements.Length; i++) elements[i] = 1; list.Add((int[)elements.Clone()); Sort(list); foreach (int[ array in list) { PrintArray(array); } } Console.ReadKey(); } private static void Sort(List<int[> list) { list.Sort(new ArraySorter()); list.Reverse(); } private static void SumUp(int[ array, List<int[> list) { int start = 0; do { if (!Exists(array, list)) list.Add((int[)array.Clone()); if (start < array.Length - 2) start++; if ((array[start - 1] >= array[start] + array[start + 1]) || (array[start] == array[start + 1])) { if (array[0] == array[1] + 1) Console.WriteLine(array[0].ToString() + " " + array[start].ToString() + " " + array[start + 1].ToString()); array[start] += array[start + 1]; for (int i = start + 1; i < array.Length - 1; i++) { array[i] = array[i + 1]; } array[array.Length - 1] = 0; if ((start <= array.Length - 3) && (array[0] == array[start + 1] + array[start + 2])) start--; else if ((array[start - 1] >= array[start] + array[start + 1]) && (array[start + 1] > 0)) start--; } } while (start < array.Length - 2); } private static bool Exists(int[ array, List<int[> ylist) { foreach (int[ item in list) { if (ArrayEquals(item, array)) return true; } return false; } private static bool ArrayEquals(int[ array1, int[ array2) { if (array1.Length != array2.Length) return false; for (int i = 0; i < array1.Length; i++) { if (array1[i] != array2[i]) return false; } return true; } private static void PrintArray(int[ array, string title) { Console.WriteLine(title + ":"); Console.WriteLine(); string text = ""; for (int i = 0; i < array.GetLength(0); i++) { text += array[i].ToString() + " "; } Console.WriteLine(text); } private static void PrintArray(int[ array) { string text = ""; for (int i = 0; i < array.GetLength(0); i++) { text += array[i].ToString() + " "; } Console.WriteLine(text); } } public class ArraySorter : IComparer<int[> { public int Compare(int[ x, int[ y) { if (x.Length < y.Length) return -1; if (x.Length > y.Length) return 1; if (x.Length == y.Length) { Sort(x); Sort(y); for (int i = 0; i < x.Length; i++) { if (x[i] < y[i]) return -1; if (x[i] > y[i]) return 1; } return 0; } return 0; } private static void Sort(int[ array) { for (int i = 0; i < array.Length - 1; i++) { for (int j = i + 1; j < array.Length; j++) { if (array[i] < array[j]) { int help = array[i]; array[i] = array[j]; array[j] = help; } } } }
} }
Siegfried Pammer
|
|
-
-
siegi44


- Joined on 03-31-2006
- Steyr, Austria
- Posts 187

|
Re: Request for Debugger testing
After some runs now I got an exception (I ignored it) and the debugger terminated and now every time I want to run my app with or without the debugger I get the following error (sorry, it's German, but you can look up the number in the SDK): Datei obj\Debug\Test.pdb kann nicht in bin\Debug\Test.pdb kopiert werden. Der Prozess kann nicht auf die Datei bin\Debug\Test.pdb zugreifen, da sie von einem anderen Prozess verwendet wird. (MSB3021) The only solution is to restart SD completely I also noticed that ICSharpCode.SharpDevelop.BuildWorker.exe is running while debugging, is that correct?
Siegfried Pammer
|
|
-
-
DanielGrunwald


- Joined on 08-22-2005
- Hildesheim, Germany
- Posts 2.292

|
Re: Request for Debugger testing
Debugging unit tests gives "Object is in wrong AppDomain". Create a new Class Library project called "NUnitTest", add a reference to NUnit.Framework.dll Replace the code in MyClass.cs with this: using System; using System.Collections.Generic; using NUnit.Framework;
namespace NUnitTest { [TestFixture] public class MyClass { string field = "Test"; [Test] public void Test() { HelperClass helper = new HelperClass(); Console.WriteLine(field); Console.WriteLine(helper.Message); } } class HelperClass { public string Message = "Hello"; } } Set a breakpoint on line 16 ("Console.WriteLine(field);"). Open the unit testing pad, choose "Run with debugger" from context menu. Open the local variable pad: it shows two entries "this" and "helper", both with the error "Object is in wrong AppDomain", it is not possible to expand them. The tooltip for "helper" also shows this error. However, the tooltips for "field" and for "helper.Message" work correctly.
Daniel Grunwald
|
|
-
-
DavidSrbecky


- Joined on 08-22-2005
- Usti nad Labem, Czech Republic
- Posts 442

|
Re: Request for Debugger testing
Fixed & Added tests for Debugger.Interop.CorDebug.ICorDebugType.GetBase. For some reason the Debugging API does not return base class for array and primitive types. Hardcoded resturn of System.Array and System.Object. The .pdb releasing is pain since there is no method to explicitly release the pbd. It should release if there are no exceptions though. Watch out for if and let me know if it ever happens without debuger exceptions.
|
|
-
-
-
asl


- Joined on 12-14-2005
- Posts 401
|
Re: Request for Debugger testing
To reproduce it:
1.- Create a new C# Windows Forms Solution named "test" 2.- Add a breakpoint at line 27 in "Program.cs" file (Application.SetCompatibleTextRenderingDefault(false);) 3.- Start the debugger and when the breakpoint is reached, press F11 (Step into) one time. 4.- Now stop the debugger.
The following unhundled exception is thrown:
SharpDevelop Version : 3.0.0.2917 .NET Version : 2.0.50727.1433 OS Version : Microsoft Windows NT 5.1.2600 Service Pack 2 Current culture : Spanish (Uruguay) (es-UY) Current UI language : en Working Set Memory : 62308kb GC Heap Memory : 23408kb
Exception thrown: System.Runtime.InteropServices.COMException (0x80131301): Process was terminated. (Exception from HRESULT: 0x80131301) at Debugger.Interop.CorDebug.ICorDebugProcess.Continue(Int32 fIsOutOfBand) at Debugger.ManagedCallback.ExitCallback_Continue() at Debugger.ManagedCallback.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) at Debugger.ManagedCallbackProxy.<>c__DisplayClass1.<StepComplete>b__0() at Debugger.Interop.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0() at Debugger.Interop.MTA2STA.PerformCall() at Debugger.Interop.MTA2STA.PerformAllCalls() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
|
|
-
-
DavidSrbecky


- Joined on 08-22-2005
- Usti nad Labem, Czech Republic
- Posts 442

|
Re: Request for Debugger testing
Wow this particular "Process was terminated" bug does have a history. I have found at least 22 past bug resports of it. 18 of them did not have any reproductions steps whatsoever and the remaining 4 did not happen to point me to the exact spot - not really a mistake of the reportes, the bug was just difficult to find with the old debugger design. The problem was that terminate command really did "Continue & Break & Terminate" (I think was a hack for .NET 1.1, we need just "Break & Terminate" now). The continue caused more debugger callbacks being process... which is a bad thing in the middle of being killed. Without the "Continue" it should be fine now. And working on it, I have also made sure that *all* callbacks are pooled from the queue as soon as possible so there is nothing to process now anyway.
|
|
-
-
asl


- Joined on 12-14-2005
- Posts 401
|
Re: Request for Debugger testing
I've added a new Debugger Bug Report: SD2-1387
|
|
-
-
Simon Thum


- Joined on 10-25-2007
- Posts 56
|
Re: Request for Debugger testing
My 2 Cents: SharpDevelop Version : 3.0.0.2935 .NET Version : 2.0.50727.1433 OS Version : Microsoft Windows NT 5.1.2600 Service Pack 2 Current culture : German (Germany) (de-DE) Working Set Memory : 85816kb GC Heap Memory : 27402kb
Error while requesting tooltip for location (Line 101, Col 11) Exception thrown: Debugger.DebuggerException: Debugee state already created bei Debugger.Process.CreateDebuggeeState() bei Debugger.ManagedCallback.Pause() bei Debugger.ManagedCallback.ExitCallback() bei Debugger.ManagedCallback.CreateThread(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread) bei Debugger.ManagedCallbackProxy.<>c__DisplayClass16.<CreateThread>b__15() bei Debugger.Interop.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0() bei Debugger.Interop.MTA2STA.PerformCall() bei Debugger.Process.WaitForPause(TimeSpan timeout) bei Debugger.Eval.WaitForResult() bei Debugger.Eval.InvokeMethod(MethodInfo method, Value thisValue, Value[ args) bei Debugger.Eval.InvokeMethod(Process process, Nullable`1 domainID, Type type, String name, Value thisValue, Value[ args) bei Debugger.Value.InvokeToString() bei Debugger.AddIn.TreeModel.ValueNode..ctor(Value val) bei Debugger.AddIn.TreeModel.ValueNode.Create(Expression expression) bei ICSharpCode.SharpDevelop.Services.WindowsDebugger.GetTooltipControl(String variableName) bei ICSharpCode.SharpDevelop.Debugging.DebuggerService.GetToolTipInfo(TextArea textArea, ToolTipRequestEventArgs e) bei ICSharpCode.SharpDevelop.Debugging.DebuggerTextAreaToolTipProvider.GetToolTipInfo(TextArea textArea, ToolTipRequestEventArgs e) bei ICSharpCode.SharpDevelop.Debugging.DebuggerService.TextAreaToolTipRequest(Object sender, ToolTipRequestEventArgs e) Occurred initially when hovering over a local's property (which might be problematic to evalute since it is lazy), then it worked, then again it threw the same exception and subsequently only came up with documentation (no values), though the debugger was running. Or at least the blue arrow and the stop symbol were there, it said to be in debug layout though it was actually in normal. Yet in general a much better debugging experience than before. Edit: I found out the Property threw, but that shouldn't cause the Debugger to do so ;)
|
|
-
-
hyper.space


- Joined on 01-02-2008
- Posts 4
|
Hello, Unfortunately, SD2-952 is still an issue with the latest build (3.0.0.2937), it can be reproduced in the same manner (but not only). SharpDevelop Version : 3.0.0.2937 .NET Version : 2.0.50727.1433 OS Version : Microsoft Windows NT 6.0.6000.0 Current culture : French (France) (fr-FR) Current UI language : en-US Working Set Memory : 217120kb GC Heap Memory : 96064kb
Exception thrown: System.Runtime.InteropServices.COMException (0x8013132D): The state of the thread is invalid. (Exception from HRESULT: 0x8013132D) at Debugger.Interop.CorDebug.ICorDebugThread.EnumerateChains(ICorDebugChainEnum& ppChains) at Debugger.Wrappers.CorDebug.ICorDebugThread.EnumerateChains() at Debugger.Thread.<get_CallstackEnum>d__0.MoveNext() at Debugger.Thread.get_MostRecentStackFrameWithLoadedSymbols() at Debugger.Process.SelectMostRecentStackFrameWithLoadedSymbols() at Debugger.ManagedCallback.Pause() at Debugger.ManagedCallback.ExitCallback() at Debugger.ManagedCallbackProxy.<>c__DisplayClass7.<ControlCTrap>b__6() at Debugger.Interop.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0() at Debugger.Interop.MTA2STA.PerformCall() at Debugger.Interop.MTA2STA.PerformAllCalls() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
|
|
-
-
hyper.space


- Joined on 01-02-2008
- Posts 4
|
Re: Request for Debugger testing
Hello,
Here is an annoying but easily reproducible occurrence of the “state of the thread is invalid” exception. Using a fully patched 32 bit Vista Business (without SP1) and the latest build of SD we have to:
1) Use SharpDevelop 3.0.0. 2954; 2) Load the SharpDevelop source (same build) and wait for the loading to complete; 3) Press F5 to start debugging 4) Once the start page is displayed, the bottom pad is positioned on “Output” 5) Click on “Task List” and then on “Definition View”, you will get the exception (see below)
Note that using exactly the same setup, the bug does not occur on an (vmware based) XP system. It seems that this bug was introduced with the latest builds only (around the beginning of last week)
SharpDevelop Version : 3.0.0.2954 .NET Version : 2.0.50727.1433 OS Version : Microsoft Windows NT 6.0.6000.0 Current culture : French (France) (fr-FR) Current UI language : en-US Working Set Memory : 260744kb GC Heap Memory : 159928kb
Exception thrown: System.Runtime.InteropServices.COMException (0x8013132D): The state of the thread is invalid. (Exception from HRESULT: 0x8013132D) at Debugger.Interop.CorDebug.ICorDebugThread.EnumerateChains(ICorDebugChainEnum& ppChains) at Debugger.Wrappers.CorDebug.ICorDebugThread.EnumerateChains() at Debugger.Thread.<get_CallstackEnum>d__0.MoveNext() at Debugger.Thread.get_MostRecentStackFrameWithLoadedSymbols() at Debugger.Process.SelectMostRecentStackFrameWithLoadedSymbols() at Debugger.ManagedCallback.Pause() at Debugger.ManagedCallback.ExitCallback() at Debugger.ManagedCallback.Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, UInt32 nOffset, CorDebugExceptionCallbackType exceptionType, UInt32 dwFlags) at Debugger.ManagedCallbackProxy.<>c__DisplayClass58.<Exception>b__57() at Debugger.Interop.MTA2STA.<>c__DisplayClass3.<EnqueueCall>b__0() at Debugger.Interop.MTA2STA.PerformCall() at Debugger.Interop.MTA2STA.PerformAllCalls() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
Thank you for looking into it.
|
|
Page 1 of 1 (12 items)
|
|
|