diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index b7b29f8cd..79a38c4a5 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -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 = "3349"; + public const string Revision = "3351"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 304c7569b..c21ec1d20 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=9 -%REVISION%=3349 +%REVISION%=3351 %COREVERSION%=0 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index 2f2811cd1..ba9e218f4 100644 Binary files a/Localization/DefaultLang.resources and b/Localization/DefaultLang.resources differ diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 656614501..d113501a5 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -2,7 +2,7 @@ // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 // Machine: DESKTOP-G8V08V4 -// DateTime: 23.06.2023 13:17:35 +// DateTime: 13.09.2023 10:23:20 // UserName: ????????? // GPLEX input file // GPLEX frame file @@ -1221,15 +1221,18 @@ static sbyte Map(int code) -1, -1, -1, -1, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, -1, 28, 28, 28, 28, 28, 28}), /* NxS[ 29] */ new Table(0, 0, -1, null), -/* NxS[ 30] */ new Table(16, 34, -1, new sbyte[] {75, -1, -1, -1, -1, -1, +/* NxS[ 30] */ new Table(16, 34, -1, new sbyte[] {75, -1, -1, -1, -1, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 30, 77, -1, -1, 76}), /* NxS[ 31] */ new Table(50, 2, 74, new sbyte[] {32, -1}), /* NxS[ 32] */ new Table(50, 1, -1, new sbyte[] {74}), /* NxS[ 33] */ new Table(0, 0, -1, null), -/* NxS[ 34] */ new Table(45, 1, -1, new sbyte[] {34}), -/* NxS[ 35] */ new Table(31, 19, -1, new sbyte[] {76, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, 76}), +/* NxS[ 34] */ new Table(21, 25, -1, new sbyte[] {34, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 34}), +/* NxS[ 35] */ new Table(21, 29, -1, new sbyte[] {35, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 76, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 35, -1, -1, -1, 76}), /* NxS[ 36] */ new Table(0, 0, -1, null), /* NxS[ 37] */ new Table(0, 0, -1, null), /* NxS[ 38] */ new Table(0, 0, -1, null), @@ -1256,8 +1259,9 @@ static sbyte Map(int code) /* NxS[ 55] */ new Table(0, 0, -1, null), /* NxS[ 56] */ new Table(0, 0, -1, null), /* NxS[ 57] */ new Table(0, 0, -1, null), -/* NxS[ 58] */ new Table(31, 19, -1, new sbyte[] {58, -1, -1, -1, -1, -1, - -1, -1, -1, 58, -1, -1, -1, -1, 58, 58, -1, 58, 58}), +/* NxS[ 58] */ new Table(21, 29, -1, new sbyte[] {58, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, 58, -1, -1, + -1, -1, 58, 58, -1, 58, 58}), /* NxS[ 59] */ new Table(50, 1, -1, new sbyte[] {108}), /* NxS[ 60] */ new Table(0, 0, -1, null), /* NxS[ 61] */ new Table(0, 7, 61, new sbyte[] {-1, 61, 61, 61, 61, 61, diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex index 4fd5b3651..fe9ec07c8 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.lex @@ -20,9 +20,11 @@ Letter [[:IsLetter:]_] Digit [0-9] +Digit_ [0-9_] LetterDigit {Letter}|{Digit} ID {Letter}{LetterDigit}* HexDigit {Digit}|[abcdefABCDEF] +HexDigit_ {Digit}|[abcdefABCDEF_] DotChr [^\r\n] OneLineCmnt \/\/{DotChr}* @@ -31,13 +33,13 @@ DotChr1 [^\r\n}] NOTASCII [^\x00-x7F] CHARACTERNUM '[^'\n]' -INTNUM {Digit}+ +INTNUM {Digit}{Digit_}* BIGINTNUM {INTNUM}[bB][iI] FLOATNUM {INTNUM}\.{INTNUM} EXPNUM ({INTNUM}\.)?{INTNUM}[eE][+\-]?{INTNUM} STRINGNUM \'([^\'\n]|\'\')*\' FORMATSTRINGNUM \$\'([^\'\n]|\'\')*\' -HEXNUM ${HexDigit}+ +HEXNUM ${HexDigit}{HexDigit_}* SHARPCHARNUM #{Digit}+ OLDDIRECTIVE #{ID} IFDEF \{\$ifdef\ {DotChr1}*\} diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs index e03b652c9..eb6fbe7a4 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalParserTools.cs @@ -334,6 +334,9 @@ public const_node create_double_const(string text, SourceContext sc) { System.Globalization.NumberFormatInfo sgnfi = new System.Globalization.NumberFormatInfo(); sgnfi.NumberDecimalSeparator = "."; + + text = RemoveThousandsDelimiter(text, sc); + double val = double.Parse(text, sgnfi); cn = new double_const(val); cn.source_context = sc; @@ -357,11 +360,13 @@ public const_node create_int_const(string text, SourceContext sc) public const_node create_bigint_const(string text, SourceContext sc) { + text = RemoveThousandsDelimiter(text, sc); + var txt = text.Substring(0, text.Length - 2); - const_node cn = new bigint_const(); + var cn = new bigint_const(); try { - (cn as bigint_const).val = System.UInt64.Parse(txt); + cn.val = System.UInt64.Parse(txt); } catch (Exception) { @@ -371,12 +376,24 @@ public const_node create_bigint_const(string text, SourceContext sc) return cn; } + public string RemoveThousandsDelimiter(string s, SourceContext sc) + { + if (s.EndsWith("_") || s.Contains("__")) + { + var errstr = ParserErrorsStringResources.Get("BAD_FORMED_NUM_CONST"); + errors.Add(new SyntaxError(errstr, CurrentFileName, sc, null)); + } + + return s.Replace("_", ""); + } + public const_node create_int_const(string text, SourceContext sc, System.Globalization.NumberStyles NumberStyles) { //таблица целых констант на уровне синтаксиса // не может быть - 0 + // 32--------16----8----|----8----16--------32----------------64(bits) // [ int64 )[ int32 ]( int64 ]( uint64 ] + text = RemoveThousandsDelimiter(text, sc); if (NumberStyles == System.Globalization.NumberStyles.HexNumber) text = text.Substring(1); const_node cn = new int32_const(); diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 590193c3c..b7e572beb 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -2,7 +2,7 @@ // GPPG version 1.3.6 // Machine: DESKTOP-G8V08V4 -// DateTime: 23.06.2023 13:17:36 +// DateTime: 13.09.2023 10:23:21 // UserName: ????????? // Input file diff --git a/Parsers/PascalABCParserNewSaushkin/PABC.ymc b/Parsers/PascalABCParserNewSaushkin/PABC.ymc index 314dd3530..2a8bbee8f 100644 --- a/Parsers/PascalABCParserNewSaushkin/PABC.ymc +++ b/Parsers/PascalABCParserNewSaushkin/PABC.ymc @@ -366,6 +366,8 @@ script= + + diff --git a/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj b/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj index d64ae825b..3844551a4 100644 --- a/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj +++ b/Parsers/PascalABCParserNewSaushkin/PascalABCSaushkinParser.csproj @@ -63,6 +63,7 @@ 3.5 + 3.5 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 52e2f648a..27ac1bf27 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.9.0.3349 +3.9.0.3351 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 64c2198b1..95bb6535c 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.9.0.3349' +!define VERSION '3.9.0.3351' diff --git a/SemanticTree/SemanticTree.cs b/SemanticTree/SemanticTree.cs index 9054b9db3..ea9f20024 100644 --- a/SemanticTree/SemanticTree.cs +++ b/SemanticTree/SemanticTree.cs @@ -1711,6 +1711,16 @@ int constant_value } } + //Интерфейс для представления BigInteger констант. + public interface IBigIntConstantNode : IConstantNode + { + //Значение константы. + System.Numerics.BigInteger constant_value + { + get; + } + } + //Интерфейс для представления unsigned int констант. public interface IUIntConstantNode : IConstantNode { diff --git a/SemanticTree/SemanticTree.csproj b/SemanticTree/SemanticTree.csproj index a61943aa6..7d0bbed02 100644 --- a/SemanticTree/SemanticTree.csproj +++ b/SemanticTree/SemanticTree.csproj @@ -102,6 +102,7 @@ System.Data + System.XML diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 354c2b967..0bbdd1393 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -10158,7 +10158,6 @@ function Product(Self: sequence of BigInteger): BigInteger; extensionmethod; Result *= a end; - /// Возвращает отсортированную по возрастанию последовательность function Sorted(Self: sequence of T): sequence of T; extensionmethod; begin diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 0093e4d04..044260d17 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -17778,7 +17778,7 @@ public override void visit(SyntaxTree.int32_const int32) motivation_keeper.reset(); switch (mot) { - case motivation.address_receiving: throw new CompilerInternalError("Addres receiving from constant"); + case motivation.address_receiving: throw new CompilerInternalError("Address receiving from constant"); case motivation.expression_evaluation: return_value(en); break; case motivation.semantic_node_reciving: return_semantic_value(en); break; } diff --git a/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs index 416d4bcf2..b8355affc 100644 --- a/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs +++ b/VisualPascalABCNETLinux/DockContent/DebugVariablesListWindowForm.cs @@ -196,11 +196,11 @@ public void RefreshRow(int i) this.watchList.Rows[i].Cells[2].Value = null;//PascalABCCompiler.StringResources.Get("EXPR_VALUE_UNDEFINED_TYPE"); } else - if (rv.obj_val != null) + if (rv.monoValue != null) { try { - ValueItem vi = new ValueItem(rv.obj_val, this.watchList.Rows[i].Cells[0].Value as string, WorkbenchServiceFactory.DebuggerManager.evaluator.declaringType); + ValueItem vi = new ValueItem(rv.monoValue, this.watchList.Rows[i].Cells[0].Value as string, 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; diff --git a/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs b/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs index 26933ab60..39990fdd9 100644 --- a/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs +++ b/VisualPascalABCNETLinux/DockContent/DebugWatchListWindowForm.cs @@ -120,12 +120,12 @@ public void RefreshRow(int i) (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; } else - if (rv.obj_val != null) + if (rv.monoValue != null) { //this.ClearRow(i); try { - ValueItem vi = new ValueItem(rv.obj_val, s, WorkbenchServiceFactory.DebuggerManager.evaluator.declaringType); + 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; @@ -147,10 +147,10 @@ public void RefreshRow(int i) (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = fi; this.watchList.InvalidateCell(0, i); } - else if (rv.type != null) + else if (rv.monoType != null) { //this.ClearRow(i); - BaseTypeItem bti = new BaseTypeItem(rv.type, rv.managed_type); + BaseTypeItem bti = new BaseTypeItem(rv.monoType, rv.managed_type); (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode)._grid = this.watchList; (this.watchList.Rows[i] as AdvancedDataGridView.TreeGridNode).Content = bti; } diff --git a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs index 08b37db48..17fbeb550 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/Debugger.cs @@ -1574,13 +1574,18 @@ public ListItem FindVarByName(string var, int num_line) #if (DEBUG) Console.WriteLine(global_lv.TypeName); #endif - var tr = new Mono.Debugging.Evaluation.TypeValueReference(stackFrame.SourceBacktrace.GetEvaluationContext(stackFrame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), monoDebuggerSession.GetType(global_lv.TypeName)); - var fields = tr.GetChildReferences(Mono.Debugging.Client.EvaluationOptions.DefaultOptions); - foreach (var fi in fields) + var tm = monoDebuggerSession.GetType(global_lv.TypeName); + if (tm != null) { - if (string.Compare(fi.Name, var, true) == 0) - return new ValueItem(fi.CreateObjectValue(false, Mono.Debugging.Client.EvaluationOptions.DefaultOptions)); + var tr = new Mono.Debugging.Evaluation.TypeValueReference(stackFrame.SourceBacktrace.GetEvaluationContext(stackFrame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), tm); + var fields = tr.GetChildReferences(Mono.Debugging.Client.EvaluationOptions.DefaultOptions); + foreach (var fi in fields) + { + if (string.Compare(fi.Name, var, true) == 0) + return new ValueItem(fi.CreateObjectValue(false, Mono.Debugging.Client.EvaluationOptions.DefaultOptions)); + } } + Type global_type = AssemblyHelper.GetType(global_lv.TypeName); @@ -1600,6 +1605,7 @@ public ListItem FindVarByName(string var, int num_line) Console.WriteLine("type for static " + tm); #endif var tr = new Mono.Debugging.Evaluation.TypeValueReference(stackFrame.SourceBacktrace.GetEvaluationContext(stackFrame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), tm); + return new BaseTypeItem(tr, t); } @@ -1783,9 +1789,9 @@ public ListItem FindVarByName(string var, int num_line) vi.SpecialName = preformat; return vi; } - else if (rv.type != null) + else if (rv.monoType != null) { - return new BaseTypeItem(rv.type, rv.managed_type); + return new BaseTypeItem(rv.monoType, rv.managed_type); } } } diff --git a/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs b/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs index b825aa1fb..c25c300c4 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/ExpressionEvaluation.cs @@ -33,6 +33,7 @@ public struct RetValue : IRetValue public Value obj_val; public Mono.Debugging.Client.ObjectValue monoValue; public DebugType type; + public Mono.Debugging.Evaluation.TypeValueReference monoType; public Type managed_type; public bool syn_err; public string err_mes; @@ -325,7 +326,7 @@ public RetValue Evaluate(string expr, bool for_immediate=false) private bool need_declaring_type; - public DebugType declaringType; + public Mono.Debugger.Soft.TypeMirror declaringType; private List names = new List(); [HandleProcessCorruptedStateExceptionsAttribute] @@ -6270,11 +6271,72 @@ public override void visit(indexer _indexer) eval_stack.Push(res); return; } - if (rv.monoValue.IsArray) + if (true) { RetValue res = new RetValue(); - res.monoValue = rv.monoValue.GetArrayItem(conv_to_int_arr(indices)[0]); + Type type = AssemblyHelper.GetType(rv.monoValue.TypeName); + if (type != null && type.GetField("NullBasedArray") != null) + { + int low_bound = 0; + System.Reflection.FieldInfo fi = type.GetField("LowerIndex"); + low_bound = Convert.ToInt32(fi.GetRawConstantValue()); + int[] tmp_indices = new int[1]; + int j = 0; + try + { + object obj = indices[j++]; + int v = 0; + if (obj is Value && DebugUtils.IsEnum(obj as Value, out v)) + tmp_indices[0] = v - low_bound; + else + tmp_indices[0] = Convert.ToInt32(obj) - low_bound; + } + catch (System.FormatException) + { + throw new WrongTypeInIndexer(); + } + catch (System.InvalidCastException) + { + 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]; + check_for_out_of_range(res.obj_val); + 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()); + try + { + object obj = indices[j++]; + int v = 0; + if (obj is Value && DebugUtils.IsEnum(obj as Value, out v)) + tmp_indices[0] = v - low_bound; + else + tmp_indices[0] = Convert.ToInt32(obj) - low_bound; + } + catch (System.FormatException) + { + throw new WrongTypeInIndexer(); + } + catch (System.InvalidCastException) + { + throw new WrongTypeInIndexer(); + } + res.monoValue = nv.GetRangeOfChildren(tmp_indices[0], 1)[0]; + check_for_out_of_range(res.obj_val); + nv = res.monoValue.GetChild("NullBasedArray"); + + } + if (j < indices.Count) + throw new WrongIndexersNumber(); + eval_stack.Push(res); + } + else + res.monoValue = rv.monoValue.GetRangeOfChildren(conv_to_int_arr(indices)[0], 1)[0]; //check_for_out_of_range(res.monoValue); eval_stack.Push(res); @@ -6726,56 +6788,21 @@ public override void visit(dot_node _dot_node) if (t != null) { //DebugType dt = DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); - DebugType dt = DebugUtils.GetDebugType(t); + var tm = monoDebuggerSession.GetType(t.FullName); + var tr = new Mono.Debugging.Evaluation.TypeValueReference(stackFrame.SourceBacktrace.GetEvaluationContext(stackFrame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), tm); IList mis = new List();//dt.GetMember(id.name,BindingFlags.All); - declaringType = dt; - DebugType tmp = dt; - while (tmp != null && mis.Count == 0) - { - try - { - mis = tmp.GetMember(id.name, BindingFlags.All); - tmp = tmp.BaseType; - } - catch - { - - } - } - if (mis.Count > 0) - { - if (mis[0] is FieldInfo) - { - FieldInfo fi = mis[0] as FieldInfo; - res.obj_val = fi.GetValue(null); - if (res.obj_val == null) - throw new UnknownName(id.name); - check_for_static(res.obj_val, id.name); - } - else if (mis[0] is PropertyInfo) - { - PropertyInfo pi = mis[0] as PropertyInfo; - res.obj_val = pi.GetValue(null); - if (res.obj_val == null) - throw new UnknownName(id.name); - check_for_static(res.obj_val, id.name); - } - } - else - { - System.Reflection.FieldInfo fi = t.GetField(id.name); - if (fi != null) - res.prim_val = fi.GetRawConstantValue(); - else - throw new UnknownName(id.name); - } + declaringType = tm; + var vr = tr.GetChild(id.name, Mono.Debugging.Client.EvaluationOptions.DefaultOptions); + res.monoValue = vr.CreateObjectValue(false, Mono.Debugging.Client.EvaluationOptions.DefaultOptions); + } else { t = AssemblyHelper.GetType(name + "." + id.name); if (t != null) { - res.type = DebugUtils.GetDebugType(t);//DebugType.Create(this.debuggedProcess.GetModule(name),(uint)t.MetadataToken); + var tm = monoDebuggerSession.GetType(t.FullName); + res.monoType = new Mono.Debugging.Evaluation.TypeValueReference(stackFrame.SourceBacktrace.GetEvaluationContext(stackFrame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), tm); res.managed_type = t; } // else diff --git a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs index b4ee42ee5..3187bd71d 100644 --- a/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs +++ b/VisualPascalABCNETLinux/IB/Debugger/LocalVars.cs @@ -305,9 +305,14 @@ public override IList SubItems (frame.DebuggerSession as Mono.Debugging.Soft.SoftDebuggerSession).GetType(t.FullName)); types.Add(tr); } - var valtr = new Mono.Debugging.Evaluation.TypeValueReference(frame.SourceBacktrace.GetEvaluationContext(frame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), + var tp = (frame.DebuggerSession as Mono.Debugging.Soft.SoftDebuggerSession).GetType(val.TypeName); + if (tp != null) + { + var valtr = new Mono.Debugging.Evaluation.TypeValueReference(frame.SourceBacktrace.GetEvaluationContext(frame.Index, Mono.Debugging.Client.EvaluationOptions.DefaultOptions), (frame.DebuggerSession as Mono.Debugging.Soft.SoftDebuggerSession).GetType(val.TypeName)); - types.Add(valtr); + types.Add(valtr); + } + } catch (System.Exception e) { @@ -422,8 +427,10 @@ class ValueItem : ListItem Mono.Debugging.Client.ObjectValue monoValue; public DebugType declaringType; - - public ValueItem() {} + public Mono.Debugger.Soft.TypeMirror monoDeclaringType; + + + public ValueItem() {} public override bool IsLiteral { @@ -809,6 +816,9 @@ public override IList SubItems if (monoValue.IsObject) { + if (monoValue.TypeName.IndexOf("System.Collections.Generic.") != -1) + return list; + foreach (var element in monoValue.GetAllChildren()) { list.Add(new ValueItem(element)); @@ -891,7 +901,15 @@ public ValueItem(Value val, string name, DebugType declaringType) this.name = name; val.Changed += delegate { OnChanged(new ListItemEventArgs(this)); }; } - + + public ValueItem(Mono.Debugging.Client.ObjectValue val, string name, Mono.Debugger.Soft.TypeMirror declaringType) + { + this.monoValue = val; + this.monoDeclaringType = declaringType; + this.name = name; + val.ValueChanged += delegate { OnChanged(new ListItemEventArgs(this)); }; + } + public ValueItem(Value val, string name, DebugType declaringType, bool is_in_collect) { this.val = val; @@ -921,6 +939,7 @@ public ValueItem(NamedValue val, DebugType declaringType) public ValueItem(Mono.Debugging.Client.ObjectValue val) { this.monoValue = val; + val.ValueChanged += delegate { OnChanged(new ListItemEventArgs(this)); }; } [HandleProcessCorruptedStateExceptionsAttribute] @@ -1134,7 +1153,9 @@ List GetMembers(bool privateMembers) } catch (System.Exception e) { - +#if (DEBUG) + Console.WriteLine(e.Message+" "+e.StackTrace); +#endif } } System.Reflection.BindingFlags bf = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static; diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index 354c2b967..0bbdd1393 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -10158,7 +10158,6 @@ function Product(Self: sequence of BigInteger): BigInteger; extensionmethod; Result *= a end; - /// Возвращает отсортированную по возрастанию последовательность function Sorted(Self: sequence of T): sequence of T; extensionmethod; begin diff --git a/bin/Lng/Rus/ParserErrors.dat b/bin/Lng/Rus/ParserErrors.dat index 8d16e1721..86f2f5627 100644 --- a/bin/Lng/Rus/ParserErrors.dat +++ b/bin/Lng/Rus/ParserErrors.dat @@ -3,6 +3,7 @@ BAD_FLOAT=Слишком большое вещественное BAD_INT=Слишком большое целое +BAD_FORMED_NUM_CONST=Неверное использование разделителя в числовой константе BAD_HEX=Неправильная запись hex числа UNEXPECTED_SYMBOL{0}=Неожиданный символ '{0}' BAD_EXPR=Неверное выражение