From da40c3989fc523f5b84e4d0d5b407e27fb15b379 Mon Sep 17 00:00:00 2001 From: Ivan Bondarev Date: Mon, 29 May 2023 12:29:09 +0200 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=B2=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D1=87=D0=B8=D0=BA?= =?UTF-8?q?=D0=B5=20(=D0=B2=20=D0=B8=D0=BA=D1=81=D0=B0=D1=85=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D1=81=D0=B0=D0=BB=D0=BE=20=D1=83=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B0=20Caret,=20=D1=83=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=BB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IB/Debugger/Debugger.cs | 33 ++++++++++++--- .../IB/Debugger/DynamicTreeView.cs | 6 +++ .../IB/Debugger/LocalVars.cs | 42 ++++++++++++------- .../IB/TreeGridView/TreeGridNode.cs | 1 + .../MonoDebugging/Soft/SoftDebuggerSession.cs | 4 ++ 5 files changed, 64 insertions(+), 22 deletions(-) diff --git a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs index b771b9100..0dd9ec7e2 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs @@ -990,7 +990,7 @@ namespace VisualPascalABC { //debuggedProcess.Modules[0].SymReader.GetMethod(debuggedProcess.SelectedFunction.Token); string save_PrevFullFileName = PrevFullFileName; - Console.WriteLine(stackFrame.SourceLocation.FileName + ":" + stackFrame.SourceLocation.Line); + Console.WriteLine("jump to "+stackFrame.SourceLocation.FileName + ":" + stackFrame.SourceLocation.Line); //CodeFileDocumentControl page = null; //DebuggerService.JumpToCurrentLine(nextStatement.SourceFullFilename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn); if (!ShowDebugTabs)//esli eshe ne pokazany watch i lokal, pokazyvaem @@ -1115,8 +1115,8 @@ namespace VisualPascalABC //for (int i=0; i { + textArea.Focus(); + }; textArea.Click += OnTextAreaClick; textArea.KeyDown += OnTextAreaClick; frm.ClientSize = new Size(frm.ClientSize.Width, row.Height + 2); } + public bool IsMouseOver { get @@ -314,6 +318,7 @@ namespace VisualPascalABC ((ICSharpCode.TextEditor.TextArea)sender).KeyDown -= OnTextAreaClick; ((ICSharpCode.TextEditor.TextArea)sender).Click -= OnTextAreaClick; frm.Close(); + this.isExpanded = false; } bool isExpanded; @@ -817,6 +822,7 @@ namespace VisualPascalABC void CloseOnDeactivate() { + return; ChildForm owner = Owner as ChildForm; if (owner != null) { diff --git a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs index a1f2ec4bb..e6a42dc8a 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs @@ -669,7 +669,7 @@ namespace VisualPascalABC get { return monoValue.DisplayValue; - if (ShowValuesInHexadecimal && val.IsInteger) + /*if (ShowValuesInHexadecimal && val.IsInteger) { return String.Format("0x{0:X}", val.PrimitiveValue); } @@ -760,7 +760,7 @@ namespace VisualPascalABC { return ""; } - } + }*/ } } @@ -838,25 +838,28 @@ namespace VisualPascalABC { get { + List list = new List(); - if (val.IsArray) + + if (monoValue.IsObject) { - foreach (NamedValue element in val.GetArrayElements()) + foreach (var element in monoValue.GetAllChildren()) { - list.Add(new ValueItem(element,null)); + list.Add(new ValueItem(element)); } + return list; } - if (val.IsObject || val.Type.IsByRef() && !val.IsPrimitive) + /*if (monoValue.IsObject || !monoValue.IsPrimitive) { //if (IsArrayWrap()) //{ - NamedValue nv = GetNullBasedArray(); - if (nv != null) + var lv = GetNullBasedArray(); + if (lv != null) { int i = 0; - foreach (NamedValue element in nv.GetArrayElements()) + foreach (var element in lv.GetAllChildren()) { - list.Add(new ArrayValueItem(element, null, val, nv, i++)); + list.Add(new ArrayValueItem(element, monoValue, lv, i++)); } } @@ -866,17 +869,19 @@ namespace VisualPascalABC if (!val.Type.IsByRef()) return new BaseTypeItem(val, val.Type).SubItems; } - } + }*/ return list; } } - private NamedValue GetNullBasedArray() + private Mono.Debugging.Client.ObjectValue GetNullBasedArray() { - IList flds = val.Type.GetFields(); - if (flds.Count != 3) return null; - foreach (FieldInfo fi in flds) - if (fi.Name == "NullBasedArray") return fi.GetValue(val); + var fields = monoValue.GetAllChildren(); + if (fields.Length != 3) + return null; + foreach (var fi in fields) + if (fi.Name == "NullBasedArray") + return fi; return null; } @@ -996,6 +1001,11 @@ namespace VisualPascalABC low_bound = tmp_fi.GetValue(sz_arr); } + public ArrayValueItem(Mono.Debugging.Client.ObjectValue val, Mono.Debugging.Client.ObjectValue arr, Mono.Debugging.Client.ObjectValue sz_arr, int ind) + { + + } + public override string Name { get diff --git a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs index d87bc89de..ad399e1d9 100644 --- a/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs +++ b/VisualPascalABCNETLinux/IB/TreeGridView/TreeGridNode.cs @@ -719,6 +719,7 @@ namespace AdvancedDataGridView } catch (System.Exception e) { + Console.WriteLine(e.Message + " " + e.StackTrace); } } diff --git a/VisualPascalABCNETLinux/MonoDebugging/Soft/SoftDebuggerSession.cs b/VisualPascalABCNETLinux/MonoDebugging/Soft/SoftDebuggerSession.cs index 2b04a533f..ac5a2bb58 100644 --- a/VisualPascalABCNETLinux/MonoDebugging/Soft/SoftDebuggerSession.cs +++ b/VisualPascalABCNETLinux/MonoDebugging/Soft/SoftDebuggerSession.cs @@ -1703,6 +1703,7 @@ namespace Mono.Debugging.Soft void Step (StepDepth depth, StepSize size) { try { + //Console.WriteLine("Adaptor.CancelAsyncOperations"); Adaptor.CancelAsyncOperations (); // This call can block, so it has to run in background thread to avoid keeping the main session lock var req = vm.CreateStepRequest (current_thread); req.Depth = depth; @@ -1719,8 +1720,11 @@ namespace Mono.Debugging.Soft throw e; } currentStepRequest = req; + //Console.WriteLine("OnResumed"); OnResumed (); + //Console.WriteLine("vm.Resume"); vm.Resume (); + //Console.WriteLine("DequeueEventsForFirstThread"); DequeueEventsForFirstThread (); } catch (CommandException ex) { string reason;