Skip to content

Commit b8b0eae

Browse files
authored
Merge pull request #1233 from microsoft/main
Merge 'main' into 'release_mdd'
2 parents 37ebd39 + 80a4800 commit b8b0eae

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

.github/workflows/pull-request.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,14 @@ jobs:
7676
update: true
7777
install: >-
7878
mingw-w64-x86_64-toolchain
79-
79+
80+
- shell: msys2 {0}
81+
name: Gather c++ toolchain paths
82+
run: |
83+
cygpath -w $(which g++)
84+
cygpath -w $(which g++)
85+
86+
8087
- run: >
8188
dotnet test ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\CppTests.dll --logger "trx;LogFileName=${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\results.trx"
8289

src/MICore/CommandFactories/MICommandFactory.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public virtual Task<bool> SetStepFiltering(bool enabled)
332332
// Calls to VarCreate will change the current debugger thread and frame selection to what is passed in. This is because it needs to be queried in the context of a thread/frame id.
333333
public virtual async Task<Results> VarCreate(string expression, int threadId, uint frameLevel, enum_EVALFLAGS dwFlags, ResultClass resultClass = ResultClass.done)
334334
{
335-
string quoteEscapedExpression = EscapeQuotes(expression);
335+
string quoteEscapedExpression = EscapeQuotes(HandleInvalidChars(expression));
336336
string command = string.Format(CultureInfo.InvariantCulture, "-var-create - * \"{0}\"", quoteEscapedExpression);
337337
Results results = await ThreadFrameCmdAsync(command, resultClass, threadId, frameLevel);
338338

@@ -366,7 +366,8 @@ public async Task<Results> VarEvaluateExpression(string variableName, ResultClas
366366

367367
public virtual async Task<string> VarAssign(string variableName, string expression, int threadId, uint frameLevel)
368368
{
369-
string command = string.Format(CultureInfo.InvariantCulture, "-var-assign {0} \"{1}\"", variableName, expression);
369+
string quoteEscapedExpression = EscapeQuotes(HandleInvalidChars(expression));
370+
string command = string.Format(CultureInfo.InvariantCulture, "-var-assign {0} \"{1}\"", variableName, quoteEscapedExpression);
370371
Results results = await _debugger.CmdAsync(command, ResultClass.done);
371372
return results.FindString("value");
372373
}
@@ -618,6 +619,18 @@ internal string EscapeQuotes(string str)
618619
return str.Replace("\"", "\\\"");
619620
}
620621

622+
internal string HandleInvalidChars(string str)
623+
{
624+
char[] invalidChars = { '\r', '\n' };
625+
StringBuilder builder = new StringBuilder();
626+
foreach (char c in str)
627+
{
628+
629+
builder.Append(invalidChars.Contains(c) ? ' ' : c);
630+
}
631+
return builder.ToString();
632+
}
633+
621634
#endregion
622635

623636
#region Other

src/SSHDebugPS/UI/ContainerPickerDialogWindow.xaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,7 @@
3030
<Style x:Key="GlyphPathStyle"
3131
TargetType="{x:Type Path}">
3232
<Setter Property="Stroke"
33-
Value="{DynamicResource {x:Static platformui:TreeViewColors.GlyphBrushKey}}" />
34-
<Style.Triggers>
35-
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
36-
Value="True">
37-
<Setter Property="Stroke"
38-
Value="{DynamicResource {x:Static platformui:TreeViewColors.GlyphMouseOverBrushKey}}" />
39-
</DataTrigger>
40-
</Style.Triggers>
33+
Value="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}" />
4134
</Style>
4235
<Style x:Key="ConnectionTypeComboBoxStyle"
4336
TargetType="{x:Type ComboBox}">
@@ -309,7 +302,7 @@
309302
Data="M 5.5,2.5 L 0.5,7.5 L 5.5,7.5 Z"
310303
HorizontalAlignment="Center"
311304
SnapsToDevicePixels="false"
312-
Fill="{DynamicResource {x:Static platformui:TreeViewColors.GlyphBrushKey}}"
305+
Fill="{StaticResource {x:Static SystemColors.WindowTextBrushKey}}"
313306
StrokeThickness="2"
314307
VerticalAlignment="Center"
315308
Visibility="{Binding IsExpanded, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />

test/CppTests/TestConfigurations/config_msys_gdb.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
<Compiler
1111
Name="GppMingw64"
1212
Type="GPlusPlus"
13-
Path="D:\a\_temp\msys\msys64\mingw64\bin\g++.exe"/>
13+
Path="D:\a\_temp\msys64\mingw64\bin\g++.exe"/>
1414
</Compilers>
1515
<Debuggers>
1616
<Debugger
1717
Name="GdbMingw64"
1818
Type="Gdb_MinGW"
19-
Path="D:\a\_temp\msys\msys64\mingw64\bin\gdb.exe"
19+
Path="D:\a\_temp\msys64\mingw64\bin\gdb.exe"
2020
AdapterPath="OpenDebugAD7.exe"
2121
/>
2222
</Debuggers>

0 commit comments

Comments
 (0)