From 211078fc3904aeb6bd2d5c31dbfa175d3aa8fc10 Mon Sep 17 00:00:00 2001 From: Ivan Bondarev Date: Mon, 29 May 2023 16:41:31 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D1=87?= =?UTF-8?q?=D0=B8=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IB/Debugger/Debugger.cs | 52 ++++++++++++++----- .../IB/Debugger/DynamicTreeView.cs | 24 +++++++-- .../MonoDebugging/Client/EvaluationOptions.cs | 4 +- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs index 0dd9ec7e2..7c331447a 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs @@ -1142,7 +1142,6 @@ namespace VisualPascalABC dbg.RemoveBreakpoint(currentBreakpoint); currentBreakpoint = null; //RemoveBreakpoints(); } - Console.WriteLine("breakpoints removed"); } } @@ -1418,10 +1417,14 @@ namespace VisualPascalABC List unit_lvs = new List(); var lvc = stackFrame.GetAllLocals(); foreach (var lv in lvc) + { if (lv.Name == var) return new ValueItem(lv); + } + foreach (var lv in lvc) { + Console.WriteLine("local var "+lv.Name); if (lv.Name.IndexOf(':') != -1) { int pos = lv.Name.IndexOf(':'); @@ -1440,10 +1443,18 @@ namespace VisualPascalABC } else if (string.Compare(lv.Name, "self", true) == 0 && stackFrame.GetThisReference() != null) return new ValueItem(stackFrame.GetThisReference()); - else if (lv.Name.Contains("$class_var")) global_lv = lv; - else if (lv.Name.Contains("$unit_var")) unit_lvs.Add(lv); - else if (lv.Name == "$disp$") disp_lv = lv;//vo vlozhennyh procedurah ssylka na verh zapis aktivacii - else if (lv.Name.StartsWith("$rv")) ret_lv = lv;//vozvrashaemoe znachenie + else if (lv.Name.Contains("$class_var")) + { + + global_lv = lv; + } + + else if (lv.Name.Contains("$unit_var")) + unit_lvs.Add(lv); + else if (lv.Name == "$disp$") + disp_lv = lv;//vo vlozhennyh procedurah ssylka na verh zapis aktivacii + else if (lv.Name.StartsWith("$rv")) + ret_lv = lv;//vozvrashaemoe znachenie } lvc = stackFrame.GetParameters(); Mono.Debugging.Client.ObjectValue self_lv = null; @@ -1488,19 +1499,37 @@ namespace VisualPascalABC parent_val = pv; } } - if (self_lv != null) + if (stackFrame.GetThisReference() != null) { - var fields = self_lv.GetAllChildren(); + var fields = stackFrame.GetThisReference().GetAllChildren(); foreach (var fi in fields) + { + if (string.Compare(fi.Name, var, true) == 0) return new ValueItem(fi); + } + } + if (self_lv != null) + { + Console.WriteLine("search in this"); + var fields = self_lv.GetAllChildren(); + foreach (var fi in fields) + { + if (string.Compare(fi.Name, var, true) == 0) + return new ValueItem(fi); + } + } if (global_lv != null) { - var fields = self_lv.GetAllChildren(); + var fields = global_lv.GetAllChildren(); + foreach (var fi in fields) - if (string.Compare(fi.Name, var, true) == 0) + { + if (string.Compare(fi.Name, var, true) == 0) return new ValueItem(fi); + } + Type global_type = AssemblyHelper.GetType(global_lv.TypeName); if (global_type != null) { @@ -1775,13 +1804,12 @@ namespace VisualPascalABC toolTipControl = ti.ToolTipControl as DebuggerGridControl; if (ti.ToolTipText != null) { - e.ShowToolTip(ti.ToolTipText); + //e.ShowToolTip(ti.ToolTipText); } } CloseOldToolTip(); if (toolTipControl != null) { - toolTipControl.ShowForm(textArea, e.LogicalPosition); } oldToolTipControl = toolTipControl; @@ -1796,7 +1824,7 @@ namespace VisualPascalABC } finally { - if (toolTipControl == null && CanCloseOldToolTip) + if (toolTipControl == null && CanCloseOldToolTip && !oldToolTipControl.IsMouseOver) { CloseOldToolTip(); RemoveMarker((sender as TextArea).Document); diff --git a/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs b/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs index 05e3c36e2..996eaf51f 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/DynamicTreeView.cs @@ -291,15 +291,33 @@ namespace VisualPascalABC Dock = DockStyle.Fill; frm.Controls.Add(this); frm.ShowWindowWithoutActivation = true; + frm.KeyPreview = true; + frm.KeyDown += DebuggerGridControl_KeyDown; frm.Show(); - frm.GotFocus += (s, e) => { - textArea.Focus(); - }; + textArea.Click += OnTextAreaClick; textArea.KeyDown += OnTextAreaClick; frm.ClientSize = new Size(frm.ClientSize.Width, row.Height + 2); } + private void DebuggerGridControl_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.F8) + { + WorkbenchServiceFactory.DebuggerManager.Status = DebugStatus.StepOver; + WorkbenchServiceFactory.DebuggerManager.StepOver(); + } + } + + private void Frm_KeyDown(object sender, KeyEventArgs e) + { + + } + + private void TextArea_LostFocus(object sender, EventArgs e) + { + + } public bool IsMouseOver { diff --git a/VisualPascalABCNETLinux/MonoDebugging/Client/EvaluationOptions.cs b/VisualPascalABCNETLinux/MonoDebugging/Client/EvaluationOptions.cs index 1475ddb99..e2794d833 100644 --- a/VisualPascalABCNETLinux/MonoDebugging/Client/EvaluationOptions.cs +++ b/VisualPascalABCNETLinux/MonoDebugging/Client/EvaluationOptions.cs @@ -45,8 +45,8 @@ namespace Mono.Debugging.Client ops.AllowMethodEvaluation = true; ops.AllowToStringCalls = true; ops.FlattenHierarchy = true; - ops.GroupPrivateMembers = true; - ops.GroupStaticMembers = true; + ops.GroupPrivateMembers = false; + ops.GroupStaticMembers = false; ops.UseExternalTypeResolver = true; ops.IntegerDisplayFormat = IntegerDisplayFormat.Decimal; ops.CurrentExceptionTag = "$exception";