Skip to content

Commit 8ce5af7

Browse files
authored
Address the warnings from build output (#1456)
* Address the warnings from build output * Forgot some tasks * Update test task
1 parent 48a9cbe commit 8ce5af7

5 files changed

Lines changed: 42 additions & 41 deletions

File tree

.github/workflows/Build-And-Test.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
2828

2929
- name: Install .NET Core
30-
uses: actions/setup-dotnet@v3
30+
uses: actions/setup-dotnet@v4
3131
with:
3232
dotnet-version: 8.0.x
3333

3434
- name: Setup MSBuild.exe
35-
uses: microsoft/setup-msbuild@v1.1
35+
uses: microsoft/setup-msbuild@v2
3636

3737
- name: Setup NuGet.exe for use with actions
38-
uses: NuGet/setup-nuget@v1
38+
uses: NuGet/setup-nuget@v2
3939

4040
- name: Build MIDebugEngine
4141
run: |
@@ -44,7 +44,7 @@ jobs:
4444
Configuration: ${{ matrix.configuration }}
4545

4646
- name: Setup VSTest.console.exe
47-
uses: darenm/Setup-VSTest@v1.2
47+
uses: darenm/Setup-VSTest@v1.3
4848

4949
- name: Run VS Extension tests
5050
run: vstest.console.exe ${{ github.workspace }}\bin\${{ matrix.configuration }}\MICoreUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\JDbgUnitTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\SSHDebugTests.dll ${{ github.workspace }}\bin\${{ matrix.configuration }}\MIDebugEngineUnitTests.dll
@@ -54,20 +54,20 @@ jobs:
5454

5555
steps:
5656
- name: Checkout
57-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5858
with:
5959
fetch-depth: 0
6060

6161
- name: Install .NET Core
62-
uses: actions/setup-dotnet@v3
62+
uses: actions/setup-dotnet@v4
6363
with:
6464
dotnet-version: 8.0.x
6565

6666
- name: Setup MSBuild.exe
67-
uses: microsoft/setup-msbuild@v1.1
67+
uses: microsoft/setup-msbuild@v2
6868

6969
- name: Setup NuGet.exe for use with actions
70-
uses: NuGet/setup-nuget@v1
70+
uses: NuGet/setup-nuget@v2
7171

7272
- name: Build MIDebugEngine
7373
run: |
@@ -102,7 +102,7 @@ jobs:
102102
dotnet test $CppTestsPath --logger "trx;LogFileName=$ResultsPath"
103103
104104
- name: 'Upload Test Results'
105-
uses: actions/upload-artifact@v3
105+
uses: actions/upload-artifact@v4
106106
if: ${{ always() }}
107107
with:
108108
name: win_msys2_x64_results
@@ -112,12 +112,12 @@ jobs:
112112
runs-on: ubuntu-latest
113113
steps:
114114
- name: Checkout
115-
uses: actions/checkout@v3
115+
uses: actions/checkout@v4
116116
with:
117117
fetch-depth: 0
118118

119119
- name: Install .NET Core
120-
uses: actions/setup-dotnet@v3
120+
uses: actions/setup-dotnet@v4
121121
with:
122122
dotnet-version: 8.0.x
123123

@@ -143,7 +143,7 @@ jobs:
143143
${{ github.workspace }}/eng/Scripts/CI-Test.sh
144144
145145
- name: 'Upload Test Results'
146-
uses: actions/upload-artifact@v3
146+
uses: actions/upload-artifact@v4
147147
if: ${{ always() }}
148148
with:
149149
name: linux_x64_results
@@ -153,12 +153,12 @@ jobs:
153153
runs-on: macos-12
154154
steps:
155155
- name: Checkout
156-
uses: actions/checkout@v3
156+
uses: actions/checkout@v4
157157
with:
158158
fetch-depth: 0
159159

160160
- name: Install .NET Core
161-
uses: actions/setup-dotnet@v3
161+
uses: actions/setup-dotnet@v4
162162
with:
163163
dotnet-version: 8.0.x
164164

@@ -172,7 +172,7 @@ jobs:
172172
${{ github.workspace }}/eng/Scripts/CI-Test.sh
173173
174174
- name: 'Upload Test Results'
175-
uses: actions/upload-artifact@v3
175+
uses: actions/upload-artifact@v4
176176
if: ${{ always() }}
177177
with:
178178
name: osx_x64_results

src/DebugEngineHost/HostOutputWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static void Write(string message, string pane = DefaultOutputPane)
117117
}
118118

119119
// Output the text
120-
outputPane.OutputString(message);
120+
outputPane.OutputStringThreadSafe(message);
121121
}
122122
catch (Exception)
123123
{

src/MIDebugPackage/MIDebugPackagePackage.cs

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -405,29 +405,36 @@ private void EnableLogging(bool sendToOutputWindow, string logFile)
405405
ThreadHelper.ThrowIfNotOnUIThread();
406406

407407
IVsDebugger debugger = (IVsDebugger)GetService(typeof(IVsDebugger));
408-
DBGMODE[] mode = new DBGMODE[] { DBGMODE.DBGMODE_Design };
409-
int hr = debugger.GetMode(mode);
410-
411-
if (hr == VSConstants.S_OK && mode[0] != DBGMODE.DBGMODE_Design)
408+
if (debugger != null)
412409
{
413-
throw new ArgumentException("Unable to update MIDebugLog while debugging.");
414-
}
410+
DBGMODE[] mode = new DBGMODE[] { DBGMODE.DBGMODE_Design };
411+
int hr = debugger.GetMode(mode);
415412

416-
try
417-
{
418-
MIDebugCommandDispatcher.EnableLogging(sendToOutputWindow, logFile);
419-
}
420-
catch (Exception e)
421-
{
422-
var commandWindow = (IVsCommandWindow)GetService(typeof(SVsCommandWindow));
423-
if (commandWindow != null)
413+
if (hr == VSConstants.S_OK && mode[0] != DBGMODE.DBGMODE_Design)
424414
{
425-
commandWindow.Print(string.Format(CultureInfo.CurrentCulture, "Error: {0}\r\n", e.Message));
415+
throw new ArgumentException("Unable to update MIDebugLog while debugging.");
426416
}
427-
else
417+
418+
try
428419
{
429-
throw new InvalidOperationException("Why is IVsCommandWindow null?");
420+
MIDebugCommandDispatcher.EnableLogging(sendToOutputWindow, logFile);
430421
}
422+
catch (Exception e)
423+
{
424+
var commandWindow = (IVsCommandWindow)GetService(typeof(SVsCommandWindow));
425+
if (commandWindow != null)
426+
{
427+
commandWindow.Print(string.Format(CultureInfo.CurrentCulture, "Error: {0}\r\n", e.Message));
428+
}
429+
else
430+
{
431+
throw new InvalidOperationException("Why is IVsCommandWindow null?");
432+
}
433+
}
434+
}
435+
else
436+
{
437+
throw new InvalidOperationException("Why is IVsDebugger null?");
431438
}
432439
}
433440

src/SSHDebugPS/VsOutputWindowWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static void Write(string message, string pane = DefaultOutputPane)
118118
}
119119

120120
// Output the text
121-
outputPane.OutputString(message);
121+
outputPane.OutputStringThreadSafe(message);
122122
}
123123
catch (Exception)
124124
{

test/DebuggerTesting/OpenDebug/RunnerException.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,5 @@ public RunnerException(string message, Exception innerException)
3232

3333
public RunnerException(Exception innerException, string messageFormat, params object[] messageArgs)
3434
: base(string.Format(CultureInfo.CurrentCulture, messageFormat, messageArgs), innerException) { }
35-
36-
#if !CORECLR
37-
// Required for serialization
38-
protected RunnerException(SerializationInfo info, StreamingContext context)
39-
: base(info, context) { }
40-
#endif
4135
}
4236
}

0 commit comments

Comments
 (0)