Add MI/GDB test for breakpoint source file name and line resolve.
authorMikhail Kurinnoi <m.kurinnoi@samsung.com>
Fri, 14 Aug 2020 16:07:45 +0000 (19:07 +0300)
committerAlexander Soldatov/Platform Lab /SRR/Staff Engineer/Samsung Electronics <soldatov.a@samsung.com>
Fri, 21 Aug 2020 09:22:15 +0000 (12:22 +0300)
test-suite/MITestSrcBreakpointResolve/MITestSrcBreakpointResolve.csproj [new file with mode: 0644]
test-suite/MITestSrcBreakpointResolve/Program.cs [new file with mode: 0644]
test-suite/MITestSrcBreakpointResolve/folder/Program.cs [new file with mode: 0644]
test-suite/XunitTests/LocalTest.cs
test-suite/XunitTests/XunitTests.csproj
test-suite/run_tests.ps1
test-suite/run_tests.sh
test-suite/sdb_run_tests.ps1
test-suite/sdb_run_tests.sh
test-suite/test-suite.sln

diff --git a/test-suite/MITestSrcBreakpointResolve/MITestSrcBreakpointResolve.csproj b/test-suite/MITestSrcBreakpointResolve/MITestSrcBreakpointResolve.csproj
new file mode 100644 (file)
index 0000000..1765610
--- /dev/null
@@ -0,0 +1,12 @@
+<Project Sdk="Microsoft.NET.Sdk">\r
+\r
+  <ItemGroup>
+    <ProjectReference Include="..\NetcoreDbgTest\NetcoreDbgTest.csproj" />
+  </ItemGroup>\r
+\r
+  <PropertyGroup>\r
+    <OutputType>Exe</OutputType>\r
+    <TargetFramework>netcoreapp3.1</TargetFramework>\r
+  </PropertyGroup>\r
+\r
+</Project>\r
diff --git a/test-suite/MITestSrcBreakpointResolve/Program.cs b/test-suite/MITestSrcBreakpointResolve/Program.cs
new file mode 100644 (file)
index 0000000..2e95044
--- /dev/null
@@ -0,0 +1,289 @@
+using System;\r
+using System.IO;\r
+\r
+using NetcoreDbgTest;\r
+using NetcoreDbgTest.MI;\r
+using NetcoreDbgTest.Script;\r
+\r
+using Xunit;\r
+\r
+namespace NetcoreDbgTest.Script\r
+{\r
+    class Context\r
+    {\r
+        public static void Prepare()\r
+        {\r
+            Assert.Equal(MIResultClass.Done,\r
+                         MIDebugger.Request("-file-exec-and-symbols "\r
+                                            + DebuggeeInfo.CorerunPath).Class);\r
+\r
+            Assert.Equal(MIResultClass.Done,\r
+                         MIDebugger.Request("-exec-arguments "\r
+                                            + DebuggeeInfo.TargetAssemblyPath).Class);\r
+\r
+            Assert.Equal(MIResultClass.Running, MIDebugger.Request("-exec-run").Class);\r
+        }\r
+\r
+        static bool IsStoppedEvent(MIOutOfBandRecord record)\r
+        {\r
+            if (record.Type != MIOutOfBandRecordType.Async) {\r
+                return false;\r
+            }\r
+\r
+            var asyncRecord = (MIAsyncRecord)record;\r
+\r
+            if (asyncRecord.Class != MIAsyncRecordClass.Exec ||\r
+                asyncRecord.Output.Class != MIAsyncOutputClass.Stopped) {\r
+                return false;\r
+            }\r
+\r
+            return true;\r
+        }\r
+\r
+        public static void WasEntryPointHit()\r
+        {\r
+            Func<MIOutOfBandRecord, bool> filter = (record) => {\r
+                if (!IsStoppedEvent(record)) {\r
+                    return false;\r
+                }\r
+\r
+                var output = ((MIAsyncRecord)record).Output;\r
+                var reason = (MIConst)output["reason"];\r
+\r
+                if (reason.CString != "entry-point-hit") {\r
+                    return false;\r
+                }\r
+\r
+                var frame = (MITuple)(output["frame"]);\r
+                var func = (MIConst)(frame["func"]);\r
+                if (func.CString == DebuggeeInfo.TestName + ".Program.Main()") {\r
+                    return true;\r
+                }\r
+\r
+                return false;\r
+            };\r
+\r
+            if (!MIDebugger.IsEventReceived(filter))\r
+                throw new NetcoreDbgTestCore.ResultNotSuccessException();\r
+        }\r
+\r
+        public static void WasBreakpointHit(Breakpoint breakpoint)\r
+        {\r
+            var bp = (LineBreakpoint)breakpoint;\r
+\r
+            Func<MIOutOfBandRecord, bool> filter = (record) => {\r
+                if (!IsStoppedEvent(record)) {\r
+                    return false;\r
+                }\r
+\r
+                var output = ((MIAsyncRecord)record).Output;\r
+                var reason = (MIConst)output["reason"];\r
+\r
+                if (reason.CString != "breakpoint-hit") {\r
+                    return false;\r
+                }\r
+\r
+                var frame = (MITuple)(output["frame"]);\r
+                var fileName = (MIConst)(frame["file"]);\r
+                var numLine = (MIConst)(frame["line"]);\r
+\r
+                if (fileName.CString == bp.FileName &&\r
+                    numLine.CString == bp.NumLine.ToString()) {\r
+                    return true;\r
+                }\r
+\r
+                return false;\r
+            };\r
+\r
+            if (!MIDebugger.IsEventReceived(filter))\r
+                throw new NetcoreDbgTestCore.ResultNotSuccessException();\r
+        }\r
+\r
+        public static void WasExit()\r
+        {\r
+            Func<MIOutOfBandRecord, bool> filter = (record) => {\r
+                if (!IsStoppedEvent(record)) {\r
+                    return false;\r
+                }\r
+\r
+                var output = ((MIAsyncRecord)record).Output;\r
+                var reason = (MIConst)output["reason"];\r
+\r
+                if (reason.CString != "exited") {\r
+                    return false;\r
+                }\r
+\r
+                var exitCode = (MIConst)output["exit-code"];\r
+\r
+                if (exitCode.CString == "0") {\r
+                    return true;\r
+                }\r
+\r
+                return false;\r
+            };\r
+\r
+            if (!MIDebugger.IsEventReceived(filter))\r
+                throw new NetcoreDbgTestCore.ResultNotSuccessException();\r
+        }\r
+\r
+        public static void DebuggerExit()\r
+        {\r
+            Assert.Equal(MIResultClass.Exit, Context.MIDebugger.Request("-gdb-exit").Class);\r
+        }\r
+\r
+        public static string EnableBreakpoint(string bpName, string bpPath = null)\r
+        {\r
+            Breakpoint bp = DebuggeeInfo.Breakpoints[bpName];\r
+\r
+            Assert.Equal(BreakpointType.Line, bp.Type);\r
+\r
+            var lbp = (LineBreakpoint)bp;\r
+\r
+            var BpResp =  MIDebugger.Request("-break-insert -f " + (bpPath != null ? bpPath : lbp.FileName)  + ":" + lbp.NumLine);\r
+\r
+            Assert.Equal(MIResultClass.Done, BpResp.Class);\r
+\r
+            CurrentBpId++;\r
+\r
+            // return breakpoint id\r
+            return ((MIConst)((MITuple)BpResp["bkpt"])["number"]).CString;\r
+        }\r
+\r
+        public static void DeleteBreakpoint(string id)\r
+        {\r
+            Assert.Equal(MIResultClass.Done,\r
+                             Context.MIDebugger.Request("-break-delete " + id).Class);\r
+        }\r
+\r
+        public static void Continue()\r
+        {\r
+            Assert.Equal(MIResultClass.Running, MIDebugger.Request("-exec-continue").Class);\r
+        }\r
+\r
+        public static MIDebugger MIDebugger = new MIDebugger();\r
+        public static int CurrentBpId = 0;\r
+        public static string id_bp5;\r
+        public static string id_bp5_b;\r
+        public static string id_bp6;\r
+        public static string id_bp6_b;\r
+    }\r
+}\r
+\r
+namespace MITestSrcBreakpointResolve\r
+{\r
+    class Program\r
+    {\r
+        static void Main(string[] args)\r
+        {\r
+            Label.Checkpoint("init", "bp_test1", () => {\r
+                // setup breakpoints before process start\r
+                // in this way we will check breakpoint resolve routine during module load\r
+\r
+                var id1 = Context.EnableBreakpoint("bp0_delete_test1");\r
+                var id2 = Context.EnableBreakpoint("bp0_delete_test2");\r
+                Context.EnableBreakpoint("bp1");\r
+                Context.EnableBreakpoint("bp2", "../Program.cs");\r
+                Context.EnableBreakpoint("bp3", "MITestSrcBreakpointResolve/Program.cs");\r
+                Context.EnableBreakpoint("bp4", "./MITestSrcBreakpointResolve/folder/../Program.cs");\r
+\r
+                Context.DeleteBreakpoint(id1);\r
+\r
+                Context.Prepare();\r
+                Context.WasEntryPointHit();\r
+\r
+                Context.DeleteBreakpoint(id2);\r
+\r
+                Context.Continue();\r
+            });\r
+\r
+Label.Breakpoint("bp0_delete_test1");\r
+Label.Breakpoint("bp0_delete_test2");\r
+Label.Breakpoint("bp1");\r
+Label.Breakpoint("bp2");\r
+Label.Breakpoint("bp3");\r
+Label.Breakpoint("resolved_bp1");       Console.WriteLine(\r
+                                                          "Hello World!");          Label.Breakpoint("bp4");\r
+\r
+            Label.Checkpoint("bp_test1", "bp_test2", () => {\r
+                // check, that actually we have only one active breakpoint per line\r
+                Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["resolved_bp1"]);\r
+\r
+                // check, that we have proper breakpoint ids (check, that for MI/GDB resolved breakpoints were not re-created hiddenly with different id)\r
+                var id7 = Context.EnableBreakpoint("bp0_delete_test1"); // previously was deleted with id1\r
+                Assert.Equal(Context.CurrentBpId.ToString(), id7);\r
+                Context.DeleteBreakpoint(id7);\r
+\r
+                Context.id_bp5_b = Context.EnableBreakpoint("bp5_resolve_wrong_source", "../wrong_folder/./Program.cs");\r
+                Assert.Equal(Context.CurrentBpId.ToString(), Context.id_bp5_b);\r
+\r
+                Context.id_bp5 = Context.EnableBreakpoint("bp5");\r
+                Assert.Equal(Context.CurrentBpId.ToString(), Context.id_bp5);\r
+\r
+                Context.Continue();\r
+            });\r
+\r
+Label.Breakpoint("bp5_resolve_wrong_source"); // Console.WriteLine("Hello World!");\r
+                                        /* Console.WriteLine("Hello World!"); */\r
+                                        Console.WriteLine("Hello World!");\r
+\r
+Label.Breakpoint("bp5");                // Console.WriteLine("Hello World!");\r
+                                        /* Console.WriteLine("Hello World!"); */\r
+Label.Breakpoint("resolved_bp2");       Console.WriteLine("Hello World!");\r
+\r
+            Label.Checkpoint("bp_test2", "bp_test3", () => {\r
+                Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["resolved_bp2"]);\r
+\r
+                Context.DeleteBreakpoint(Context.id_bp5);\r
+                Context.DeleteBreakpoint(Context.id_bp5_b);\r
+\r
+                Context.id_bp6_b = Context.EnableBreakpoint("bp6_resolve_wrong_source", "./wrong_folder/Program.cs");\r
+                Assert.Equal(Context.CurrentBpId.ToString(), Context.id_bp6_b);\r
+    \r
+                Context.id_bp6 = Context.EnableBreakpoint("bp6");\r
+                Assert.Equal(Context.CurrentBpId.ToString(), Context.id_bp6);\r
+\r
+                Context.Continue();\r
+            });\r
+\r
+                                        Console.WriteLine(\r
+                                                          "Hello World!");          Label.Breakpoint("bp6_resolve_wrong_source");\r
+Label.Breakpoint("resolved_bp3");       Console.WriteLine(\r
+                                                          "Hello World!");          Label.Breakpoint("bp6");\r
+\r
+            Label.Checkpoint("bp_test3", "bp_test4", () => {\r
+                Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["resolved_bp3"]);\r
+\r
+                Context.DeleteBreakpoint(Context.id_bp6);\r
+                Context.DeleteBreakpoint(Context.id_bp6_b);\r
+\r
+                Context.EnableBreakpoint("resolved_bp4");\r
+                Context.EnableBreakpoint("bp7", "Program.cs");\r
+                Context.EnableBreakpoint("bp8", "MITestSrcBreakpointResolve/Program.cs");\r
+                var current_bp_id = Context.EnableBreakpoint("bp9", "./MITestSrcBreakpointResolve/folder/../Program.cs");\r
+\r
+                // one more check, that we have proper breakpoint ids for MI/GDB\r
+                Assert.Equal(Context.CurrentBpId.ToString(), current_bp_id);\r
+\r
+                Context.Continue();\r
+            });\r
+\r
+Label.Breakpoint("bp7");\r
+Label.Breakpoint("bp8");\r
+Label.Breakpoint("resolved_bp4");       Console.WriteLine(\r
+                                                          "Hello World!");          Label.Breakpoint("bp9");\r
+\r
+            Label.Checkpoint("bp_test4", "finish", () => {\r
+                // check, that actually we have only one active breakpoint per line\r
+                Context.WasBreakpointHit(DebuggeeInfo.Breakpoints["resolved_bp4"]);\r
+                Context.Continue();\r
+            });\r
+\r
+            MITestSrcBreakpointResolve2.Program.testfunc();\r
+\r
+            Label.Checkpoint("finish", "", () => {\r
+                Context.WasExit();\r
+                Context.DebuggerExit();\r
+            });\r
+        }\r
+    }\r
+}\r
diff --git a/test-suite/MITestSrcBreakpointResolve/folder/Program.cs b/test-suite/MITestSrcBreakpointResolve/folder/Program.cs
new file mode 100644 (file)
index 0000000..9b86591
--- /dev/null
@@ -0,0 +1,370 @@
+using System;\r
+using System.IO;\r
+\r
+namespace MITestSrcBreakpointResolve2\r
+{\r
+    class Program\r
+    {\r
+        public static void testfunc()\r
+        {\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+\r
+            //\r
+            // empty place here, since we need to catch all possible lines in case of wrong file name resolve\r
+            //\r
+\r
+            Console.WriteLine("Hello World!");\r
+        }\r
+    }\r
+}\r
index 9c8ca4923de3b8fd8ea47681fb496ce4e09177b6..e72c670ad2d314ea6dbf7b81b84c529fa6eeb08b 100644 (file)
@@ -37,6 +37,7 @@ namespace XUnitTests
         [InlineData("MITestExitCode", "Program.cs")]
         [InlineData("MITestEvalNotEnglish", "Program.cs")]
         [InlineData("MITest中文目录", "中文文件名.cs")]
+        [InlineData("MITestSrcBreakpointResolve", "Program.cs;folder/Program.cs")]
         [InlineData("VSCodeExampleTest", "Program.cs")]
         [InlineData("VSCodeTestBreakpoint", "Program.cs")]
         [InlineData("VSCodeTestFuncBreak", "Program.cs")]
index 9d3f5184ea0cfcec7645c117e162e03725ef1cca..6a6c12823f7e217067d08ace582d3df84e43bdd0 100644 (file)
     <ProjectReference Include="..\MITestHandshake\MITestHandshake.csproj" />\r
     <ProjectReference Include="..\MITestTarget\MITestTarget.csproj" />\r
     <ProjectReference Include="..\MITestExceptionBreakpoint\MITestExceptionBreakpoint.csproj" />\r
+    <ProjectReference Include="..\MITestExitCode\MITestExitCode.csproj" />\r
     <ProjectReference Include="..\MITestEvalNotEnglish\MITestEvalNotEnglish.csproj" />\r
     <ProjectReference Include="..\MITest中文目录\MITest中文目录.csproj" />\r
+    <ProjectReference Include="..\MITestSrcBreakpointResolve\MITestSrcBreakpointResolve.csproj" />\r
     <ProjectReference Include="..\VSCodeExampleTest\VSCodeExampleTest.csproj" />\r
     <ProjectReference Include="..\VSCodeTestBreakpoint\VSCodeTestBreakpoint.csproj" />\r
     <ProjectReference Include="..\VSCodeTestFuncBreak\VSCodeTestFuncBreak.csproj" />\r
@@ -45,6 +47,7 @@
     <ProjectReference Include="..\VSCodeTestEvaluate\VSCodeTestEvaluate.csproj" />\r
     <ProjectReference Include="..\VSCodeTestStepping\VSCodeTestStepping.csproj" />\r
     <ProjectReference Include="..\VSCodeTestEnv\VSCodeTestEnv.csproj" />\r
+    <ProjectReference Include="..\VSCodeTestExitCode\VSCodeTestExitCode.csproj" />\r
     <ProjectReference Include="..\VSCodeTestEvalNotEnglish\VSCodeTestEvalNotEnglish.csproj" />\r
     <ProjectReference Include="..\VSCodeTest中文目录\VSCodeTest中文目录.csproj" />\r
   </ItemGroup>\r
index 2363b16d80352d447527691396cf08137d913d3a..3ab9df5a7310add808951987781a1d6383e491d7 100644 (file)
@@ -21,6 +21,7 @@ $ALL_TEST_NAMES = @(
     "MITestExitCode"
     "MITestEvalNotEnglish"
     "MITest中文目录"
+    "MITestSrcBreakpointResolve"
     "VSCodeExampleTest"
     "VSCodeTestBreakpoint"
     "VSCodeTestFuncBreak"
@@ -58,12 +59,11 @@ $test_list = ""
 foreach ($TEST_NAME in $TEST_NAMES) {
     dotnet build $TEST_NAME
 
-    $SOURCE_FILE_LIST = (Get-ChildItem -Path $TEST_NAME -Recurse *.cs |
-        ? { $_.FullName -inotmatch "$TEST_NAME\\obj" }).Name
+    $SOURCE_FILE_LIST = (Get-ChildItem -Path "$TEST_NAME" -Recurse -Filter *.cs | Where {$_.FullName -notlike "*\obj\*"} | Resolve-path -relative).Substring(2)
 
     $SOURCE_FILES = ""
     foreach ($SOURCE_FILE in $SOURCE_FILE_LIST) {
-        $SOURCE_FILES += $TEST_NAME + "/" + $SOURCE_FILE + ";"
+        $SOURCE_FILES += $SOURCE_FILE + ";"
     }
 
     $PROTO = "mi"
index 02674d5f71dd5f78de5471a7be1cb8917417f9d0..6538638456b12ead4b9d540202fc97d250f439fc 100755 (executable)
@@ -20,6 +20,7 @@ ALL_TEST_NAMES=(
     "MITestExitCode"
     "MITestEvalNotEnglish"
     "MITest中文目录"
+    "MITestSrcBreakpointResolve"
     "VSCodeExampleTest"
     "VSCodeTestBreakpoint"
     "VSCodeTestFuncBreak"
index 1f2b10700e7ceb9356a899f607fc0b0daa6f02fc..2cc4a16fc76f823569342440c0f73767a7ab0ff1 100644 (file)
@@ -22,6 +22,7 @@ $ALL_TEST_NAMES = @(
     "MITestExceptionBreakpoint"
     "MITestExitCode"
     "MITestEvalNotEnglish"
+    "MITestSrcBreakpointResolve"
     "VSCodeExampleTest"
     "VSCodeTestBreakpoint"
     "VSCodeTestFuncBreak"
@@ -64,12 +65,11 @@ foreach ($TEST_NAME in $TEST_NAMES) {
     sdb shell chsmack -a User::App::Shared /tmp/$TEST_NAME.dll
     sdb shell chsmack -a User::App::Shared /tmp/$TEST_NAME.pdb
 
-    $SOURCE_FILE_LIST = (Get-ChildItem -Path $TEST_NAME -Recurse *.cs |
-        ? { $_.FullName -inotmatch "$TEST_NAME\\obj" }).Name
+    $SOURCE_FILE_LIST = (Get-ChildItem -Path "$TEST_NAME" -Recurse -Filter *.cs | Where {$_.FullName -notlike "*\obj\*"} | Resolve-path -relative).Substring(2)
 
     $SOURCE_FILES = ""
     foreach ($SOURCE_FILE in $SOURCE_FILE_LIST) {
-        $SOURCE_FILES += $TEST_NAME + "/" + $SOURCE_FILE + ";"
+        $SOURCE_FILES += $SOURCE_FILE + ";"
     }
 
     if ($TEST_NAME.StartsWith("VSCode")) {
index 146827c16cd84e298baa5b747f8bd878958c627c..57d4716364777083239ae134a3a8cb8c7b0cb7e3 100755 (executable)
@@ -35,6 +35,7 @@ ALL_TEST_NAMES=(
     "MITestExitCode"
     "MITestEvalNotEnglish"
     "MITest中文目录"
+    "MITestSrcBreakpointResolve"
     "VSCodeExampleTest"
     "VSCodeTestBreakpoint"
     "VSCodeTestFuncBreak"
index 01d364a7c7db8589b3234606214ca610108a29bf..424e6bbf222e9b6f2a49513ca319ea2cdd294fc6 100644 (file)
@@ -62,6 +62,7 @@ EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSCodeTestEnv", "VSCodeTestEnv\VSCodeTestEnv.csproj", "{7555F581-C632-4490-A0E4-E4F1539E9209}"
 EndProject
 <<<<<<< HEAD
+<<<<<<< HEAD
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MITestExitCode", "MITestExitCode\MITestExitCode.csproj", "{9308CF34-12C5-4D5B-A318-00AD7AC1907A}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSCodeTestExitCode", "VSCodeTestExitCode\VSCodeTestExitCode.csproj", "{045EE2A3-F595-4D40-8E1A-734CA9CEB10C}"
@@ -74,6 +75,9 @@ EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MITest中文目录", "MITest中文目录\MITest中文目录.csproj", "{6B76C4A1-D871-4A78-B284-FE8E2FCBA10D}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSCodeTest中文目录", "VSCodeTest中文目录\VSCodeTest中文目录.csproj", "{56BFF745-3A77-44BF-B068-3E13901295A1}"
+=======
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MITestSrcBreakpointResolve", "MITestSrcBreakpointResolve\MITestSrcBreakpointResolve.csproj", "{81372498-2551-49D6-8A36-4F57C4985E5E}"
+>>>>>>> Add MI/GDB test for breakpoint source file name and line resolve.
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -508,5 +512,17 @@ Global
                {56BFF745-3A77-44BF-B068-3E13901295A1}.Release|x64.Build.0 = Release|Any CPU
                {56BFF745-3A77-44BF-B068-3E13901295A1}.Release|x86.ActiveCfg = Release|Any CPU
                {56BFF745-3A77-44BF-B068-3E13901295A1}.Release|x86.Build.0 = Release|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Debug|x64.ActiveCfg = Debug|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Debug|x64.Build.0 = Debug|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Debug|x86.ActiveCfg = Debug|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Debug|x86.Build.0 = Debug|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Release|Any CPU.Build.0 = Release|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Release|x64.ActiveCfg = Release|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Release|x64.Build.0 = Release|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Release|x86.ActiveCfg = Release|Any CPU
+               {81372498-2551-49D6-8A36-4F57C4985E5E}.Release|x86.Build.0 = Release|Any CPU
        EndGlobalSection
 EndGlobal