Отладчик под Linux: точки останова

This commit is contained in:
Ivan Bondarev 2023-09-14 20:46:37 +02:00
parent 131c55e894
commit eedf01c0ad
4 changed files with 22 additions and 8 deletions

View file

@ -108,6 +108,7 @@ namespace VisualPascalABC
if ((this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).UserRow)
{
string s = this.watchList.Rows[i].Cells[0].Value as string;
RetValue rv = WorkbenchServiceFactory.DebuggerManager.Evaluate(s);
if (rv.syn_err)
{
@ -128,8 +129,8 @@ namespace VisualPascalABC
ValueItem vi = new ValueItem(rv.monoValue, s, WorkbenchServiceFactory.DebuggerManager.evaluator.declaringType);
(this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList;
(this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = vi;
this.watchList.Rows[i].Cells[1].Value = WorkbenchServiceFactory.DebuggerManager.MakeValueView(rv.obj_val);//rv.obj_val.AsString;
this.watchList.Rows[i].Cells[2].Value = DebugUtils.WrapTypeName(rv.obj_val.Type);
this.watchList.Rows[i].Cells[1].Value = rv.monoValue.Value;//rv.obj_val.AsString;
this.watchList.Rows[i].Cells[2].Value = rv.monoValue.TypeName;
this.watchList.InvalidateCell(0, i);
}
catch (System.Exception e)

View file

@ -870,9 +870,10 @@ namespace VisualPascalABC
/// </summary>
public RetValue Evaluate(string expr)
{
if (evaluator != null)
return evaluator.Evaluate(expr, false);
else return new RetValue();
if (evaluator == null)
evaluator = new ExpressionEvaluator(workbench.VisualEnvironmentCompiler, FileName);
evaluator.SetCurrentMonoFrame(monoDebuggerSession, stackFrame);
return evaluator.Evaluate(expr, false);
}
private NamedValue GetNullBasedArray(Value val)
@ -994,6 +995,7 @@ namespace VisualPascalABC
private delegate void JumpToLineDelegate(int line);
private delegate void JumpToLinePreActionsDelegate();
private delegate void SetDebugTabsVisibleInvokeDelegate(bool value);
private delegate void SetCurrentLineBookmarkDelegate(string fileName, IDocument document, int makerStartLine, int makerStartColumn, int makerEndLine, int makerEndColumn);
void JumpToLineInvoke(int line)
@ -1012,6 +1014,12 @@ namespace VisualPascalABC
CurrentLineBookmark.SetPosition(fileName, document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
}
void SetDebugTabsVisibleInvoke(bool value)
{
workbench.WidgetController.SetDebugTabsVisible(true);
workbench.WidgetController.SetAddExprMenuVisible(true);
}
/// <summary>
/// Перейти к следующей строке при отладке
/// </summary>
@ -1031,8 +1039,7 @@ namespace VisualPascalABC
if (!ShowDebugTabs)//esli eshe ne pokazany watch i lokal, pokazyvaem
{
ShowDebugTabs = true;
workbench.WidgetController.SetDebugTabsVisible(true);
workbench.WidgetController.SetAddExprMenuVisible(true);
workbench.MainForm.Invoke(new SetDebugTabsVisibleInvokeDelegate(SetDebugTabsVisibleInvoke), true);
}
if (stackFrame.SourceLocation.Line == 0xFFFFFF)
{
@ -1090,6 +1097,8 @@ namespace VisualPascalABC
bool in_comm = false;
bool beg = false;
bool in_str = false;
Console.WriteLine("2 jump to " + stackFrame.SourceLocation.FileName + ":" + stackFrame.SourceLocation.Line);
for (int i = 0; i < lseg.Words.Count; i++)
{
if (lseg.Words[i].Type == TextWordType.Word)

View file

@ -280,8 +280,10 @@ namespace VisualPascalABC
else
e = vec.StandartCompiler.ParsersController.GetExpression(fileName, expr, Errors, Warnings);
RetValue res = new RetValue(); res.syn_err = false;
try
{
if (e != null && Errors.Count == 0)
{
e.visit(this);

View file

@ -343,9 +343,11 @@ namespace VisualPascalABC
HideContent(DisassemblyWindow);
AddDebugVariablesListWindow();
HideContent(DebugVariablesListWindow);
AddDebugWatchListWindow();
HideContent(DebugWatchListWindow);
/*AddImmediateWindow();
//AddDebugWatchListWindow();
if (!Tools.IsUnix())
{
AddProjectExplorerWindow();