Skip to content

Commit

Permalink
Merge branch 'pascalabcnet:master' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
spectatorBH authored Sep 25, 2023
2 parents da4c234 + 43383d6 commit ba8f785
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "9";
public const string Build = "0";
public const string Revision = "3362";
public const string Revision = "3363";

public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
Expand Down
4 changes: 2 additions & 2 deletions Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=3362
%MINOR%=9
%REVISION%=3363
%COREVERSION%=0
%MAJOR%=3
2 changes: 1 addition & 1 deletion Release/pabcversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.0.3362
3.9.0.3363
2 changes: 1 addition & 1 deletion ReleaseGenerators/PascalABCNET_version.nsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!define VERSION '3.9.0.3362'
!define VERSION '3.9.0.3363'
20 changes: 7 additions & 13 deletions VisualPascalABCNETLinux/IB/Debugger/Debugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,16 @@ private void Process_Exited(object sender, EventArgs e)
private void MonoDebuggerSession_TargetThreadStopped(object sender, Mono.Debugging.Client.TargetEventArgs e)
{
stackFrame = e.Thread.Backtrace.GetFrame(0);
if (evaluator != null)
evaluator.SetCurrentMonoFrame(monoDebuggerSession, stackFrame);
JumpToCurrentLine();
}

private void MonoDebuggerSession_TargetStopped(object sender, Mono.Debugging.Client.TargetEventArgs e)
{
stackFrame = e.Thread.Backtrace.GetFrame(0);
if (evaluator != null)
evaluator.SetCurrentMonoFrame(monoDebuggerSession, stackFrame);
JumpToCurrentLine();
workbench.WidgetController.SetStartDebugEnabled();
WorkbenchServiceFactory.DebuggerOperationsService.RefreshPad(new FunctionItem(stackFrame).SubItems);
Expand All @@ -637,6 +641,8 @@ private void MonoDebuggerSession_TargetExceptionThrown(object sender, Mono.Debug
private void MonoDebuggerSession_TargetHitBreakpoint(object sender, Mono.Debugging.Client.TargetEventArgs e)
{
stackFrame = e.Thread.Backtrace.GetFrame(0);
if (evaluator != null)
evaluator.SetCurrentMonoFrame(monoDebuggerSession, stackFrame);
JumpToCurrentLine();
workbench.WidgetController.SetStartDebugEnabled();
}
Expand Down Expand Up @@ -2025,18 +2031,6 @@ public void StepOver()
try
{
workbench.WidgetController.SetStartDebugDisabled();
/*if (monoDebuggerSession.ActiveThread.Backtrace.GetFrame(0).SourceLocation.MethodName == ".cctor")
{
var sequencePoints = debuggedProcess.SelectedFunction.symMethod.SequencePoints;
if (sequencePoints != null && debuggedProcess.NextStatement.StartLine == sequencePoints[sequencePoints.Length-1].Line)
{
debuggedProcess.StepOut();
}
else
debuggedProcess.StepOver();
}
else
debuggedProcess.StepOver();*/

CurrentLineBookmark.Remove();
monoDebuggerSession.NextLine();
Expand Down Expand Up @@ -2101,7 +2095,7 @@ public void StepOut()
if (IsRunning)
{
workbench.WidgetController.SetStartDebugDisabled();
dbg.Processes[0].StepOut();
monoDebuggerSession.StepOut();
CurrentLineBookmark.Remove();
}
}
Expand Down
63 changes: 39 additions & 24 deletions VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,19 +290,10 @@ public RetValue Evaluate(string expr, bool for_immediate=false)
if (eval_stack.Count > 0)
{
res = eval_stack.Pop();
if (res.prim_val == null && res.obj_val != null)
if (res.obj_val.IsObject && res.obj_val.Type.IsValueType)
{
Value tmp = res.obj_val;
res.obj_val = DebugUtils.unbox(res.obj_val);
if (res.obj_val != null && res.obj_val.IsPrimitive)
{
res.prim_val = res.obj_val.PrimitiveValue;
res.obj_val = null;
}
else
res.obj_val = tmp;
}
if (res.prim_val == null && res.monoValue != null && res.monoValue.IsPrimitive)
{
res.prim_val = res.monoValue.GetRawValue();
}
}
}
else if (Errors.Count > 0)
Expand Down Expand Up @@ -766,6 +757,8 @@ private Mono.Debugging.Client.ObjectValue InvokeMethod(object type, Mono.Debugge
Mono.Debugger.Soft.Value this_obj = null;
if (obj != null)
{
if (obj.parentFrame == null)
obj.parentFrame = stackFrame;
this_obj = obj.GetRawValue() as Mono.Debugger.Soft.Value;
if (this_obj == null && obj.GetRawValue() is Mono.Debugging.Client.RawValue)
{
Expand Down Expand Up @@ -5032,7 +5025,9 @@ public Mono.Debugging.Client.ObjectValue GetValue(string var)
if (lv.Name == var)
return lv;
}

#if (DEBUG)
Console.WriteLine("find var " + var+", "+ stackFrame.SourceLocation.Line);
#endif
foreach (var lv in lvc)
{
#if (DEBUG)
Expand All @@ -5053,8 +5048,14 @@ public Mono.Debugging.Client.ObjectValue GetValue(string var)
int num_line = stackFrame.SourceLocation.Line;
int start_line = Convert.ToInt32(lv.Name.Substring(pos + 1, lv.Name.LastIndexOf(':') - pos - 1));
int end_line = Convert.ToInt32(lv.Name.Substring(lv.Name.LastIndexOf(':') + 1));
if (num_line >= start_line - 1 && num_line <= end_line - 1)
if (num_line >= start_line && num_line <= end_line)
{
#if (DEBUG)
Console.WriteLine("found var " + lv.Name);
#endif
return lv;
}

}
}
if (string.Compare(lv.Name, var, true) == 0)
Expand Down Expand Up @@ -5301,7 +5302,9 @@ public Mono.Debugging.Client.ObjectValue GetValue(string var)
catch (System.Exception e)
{
//System.Windows.Forms.MessageBox.Show(e.ToString());

#if (DEBUG)
Console.WriteLine(e.Message + " "+ e.StackTrace);
#endif
}
return null;
//throw new UnknownName(var);
Expand Down Expand Up @@ -6305,7 +6308,7 @@ public override void visit(indexer _indexer)
{
int low_bound = 0;
System.Reflection.FieldInfo fi = type.GetField("LowerIndex");
low_bound = Convert.ToInt32(fi.GetRawConstantValue());
// low_bound = Convert.ToInt32(fi.GetRawConstantValue());
int[] tmp_indices = new int[1];
int j = 0;
try
Expand All @@ -6326,14 +6329,20 @@ public override void visit(indexer _indexer)
throw new WrongTypeInIndexer();
}
//res.obj_val = cur_mi.Invoke(rv.obj_val,indices.ToArray()) as NamedValue;
var nv = rv.monoValue.GetChild("NullBasedArray");
res.monoValue = nv.GetRangeOfChildren(tmp_indices[0], 1)[0];
var tm = rv.monoValue.Type as Mono.Debugger.Soft.TypeMirror;
var mi = tm.GetMethod("get_val");
if (mi != null)
{
List<Mono.Debugging.Client.ObjectValue> ind_list = new List<Mono.Debugging.Client.ObjectValue>();
ind_list.Add(DebugUtils.MakeMonoValue(tmp_indices[0]));
res.monoValue = InvokeMethod(tm, mi, rv.monoValue, ind_list.ToArray());
}
check_for_out_of_range(res.obj_val);
nv = res.monoValue.GetChild("NullBasedArray");
var nv = res.monoValue.GetChild("NullBasedArray");
while (nv != null && j < indices.Count)
{
System.Reflection.FieldInfo tmp_fi = AssemblyHelper.GetType(res.monoValue.TypeName).GetField("LowerIndex");
low_bound = Convert.ToInt32(tmp_fi.GetRawConstantValue());
low_bound = 0;// Convert.ToInt32(tmp_fi.GetRawConstantValue());
try
{
object obj = indices[j++];
Expand All @@ -6351,10 +6360,16 @@ public override void visit(indexer _indexer)
{
throw new WrongTypeInIndexer();
}
res.monoValue = nv.GetRangeOfChildren(tmp_indices[0], 1)[0];
check_for_out_of_range(res.obj_val);
tm = res.monoValue.Type as Mono.Debugger.Soft.TypeMirror;
mi = tm.GetMethod("get_val");
if (mi != null)
{

List<Mono.Debugging.Client.ObjectValue> ind_list = new List<Mono.Debugging.Client.ObjectValue>();
ind_list.Add(DebugUtils.MakeMonoValue(tmp_indices[0]));
res.monoValue = InvokeMethod(tm, mi, res.monoValue, ind_list.ToArray());
}
nv = res.monoValue.GetChild("NullBasedArray");

}
if (j < indices.Count)
throw new WrongIndexersNumber();
Expand Down
30 changes: 13 additions & 17 deletions VisualPascalABCNETLinux/IB/FormExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,23 +266,7 @@ private void InitForm()
this.mSTEPINToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mRUNTOCURToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mDEBUGENDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();

/*this.mShowVarsMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mDEBUGSTARTToolStripMenuItem,
this.mDEBUGSTOPToolStripMenuItem,
this.mDEBUGENDToolStripMenuItem,
this._toolStripMenuItem10,
this.mSTEPOVERToolStripMenuItem,
this.mSTEPINToolStripMenuItem,
this.mSTEPToolStripMenuItem,
this.mRUNTOCURToolStripMenuItem});*/

this.mrProgram.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this._toolStripMenuItem10,
this.mSTEPOVERToolStripMenuItem,
this.mSTEPINToolStripMenuItem,
this.mSTEPToolStripMenuItem,
this.mRUNTOCURToolStripMenuItem});


this.mShowVarsMenuItem.Name = "mShowVarsMenuItem";
this.mShowVarsMenuItem.Size = new System.Drawing.Size(73, 24);
Expand Down Expand Up @@ -358,6 +342,14 @@ private void InitForm()
this.mRUNTOCURToolStripMenuItem.Text = "M_RUNTOCUR";
this.mRUNTOCURToolStripMenuItem.Enabled = true;
this.mRUNTOCURToolStripMenuItem.Click += new System.EventHandler(this.mRUNTOCURToolStripMenuItem_Click);

this.mrProgram.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this._toolStripMenuItem10,
this.mSTEPOVERToolStripMenuItem,
this.mSTEPINToolStripMenuItem,
this.mSTEPToolStripMenuItem,
this.mRUNTOCURToolStripMenuItem});

//this.tpVarList.ResumeLayout(false);
//this.ResumeLayout(false);
//this.PerformLayout();
Expand Down Expand Up @@ -462,6 +454,10 @@ private void InitForm()
this.cmRename.Click += RenameClicked;
//this.cmRename.ShortcutKeys = Keys.F2;
this.cmEditor.Items.Insert(3,cmRename);
//this.menuStrip1.SuspendLayout();
//this.menuStrip1.ResumeLayout(false);
//this.ResumeLayout(false);
//this.PerformLayout();
}

void tsIntellisense_DropDownOpened(object sender, EventArgs e)
Expand Down
5 changes: 3 additions & 2 deletions VisualPascalABCNETLinux/MonoDebugging/Client/ObjectValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class ObjectValue
EventHandler valueChanged;

[NonSerialized]
StackFrame parentFrame;
public StackFrame parentFrame;

static ObjectValue Create(IObjectValueSource source, ObjectPath path, string typeName)
{
Expand Down Expand Up @@ -357,7 +357,8 @@ public object GetRawValue ()
{
if (rawValue != null)
return rawValue;
var ops = parentFrame.DebuggerSession.EvaluationOptions.Clone ();

var ops = parentFrame.DebuggerSession.EvaluationOptions.Clone();
ops.EllipsizeStrings = false;

return GetRawValue (ops);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,11 @@ protected override void OnNextLine ()
Step (StepDepth.Over, StepSize.Line);
}

public void StepOut()
{
Step(StepDepth.Out, StepSize.Line);
}

void Step (StepDepth depth, StepSize size)
{
try {
Expand Down
1 change: 1 addition & 0 deletions _GenerateLinuxVersion.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ copy bin\ICSharpCode.TextEditorLinux.dll Release\PascalABCNETLinux\ICSharpCode.T
copy bin\Localization.dll Release\PascalABCNETLinux\Localization.dll
copy bin\Microsoft.Scripting.dll Release\PascalABCNETLinux\Microsoft.Scripting.dll
copy bin\Mono.Cecil.dll Release\PascalABCNETLinux\Mono.Cecil.dll
copy bin\Mono.Debugger.Soft.dll Release\PascalABCNETLinux\Mono.Debugger.Soft.dll
copy bin\mono_pabcIDE.bat Release\PascalABCNETLinux\mono_pabcIDE.bat
copy bin\mono_pabcnetc.bat Release\PascalABCNETLinux\mono_pabcnetc.bat
copy bin\NETGenerator.dll Release\PascalABCNETLinux\NETGenerator.dll
Expand Down

0 comments on commit ba8f785

Please sign in to comment.