Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
implementing escaped string for dotnet:// as discussed with @radical
  • Loading branch information
thaystg committed Nov 14, 2022
commit 5a1f99a08cfdbbf8ab0e37d7332c0aa63481ba17
5 changes: 3 additions & 2 deletions src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,10 +1183,11 @@ internal SourceFile(AssemblyInfo assembly, int id, DocumentHandle docHandle, Uri
this.doc = assembly.pdbMetadataReader.GetDocument(docHandle);
this.docHandle = docHandle;
this.url = url;
this.DebuggerFileName = url.Replace("\\", "/").Replace(":", "");
var urlWithSpecialCharCodedHex = EscapeAscii(url);
this.DebuggerFileName = urlWithSpecialCharCodedHex.Replace("\\", "/").Replace(":", "");
this.BreakableLines = new List<int>();

var urlWithSpecialCharCodedHex = EscapeAscii(url);

this.SourceUri = new Uri((Path.IsPathRooted(url) ? "file://" : "") + urlWithSpecialCharCodedHex, UriKind.RelativeOrAbsolute);
if (SourceUri.IsFile && File.Exists(SourceUri.LocalPath))
{
Expand Down
4 changes: 1 addition & 3 deletions src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using Xunit;
using Xunit.Sdk;
using Xunit.Abstractions;

[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)]
Expand Down Expand Up @@ -962,7 +961,7 @@ await EvaluateAndCheck(
[Theory]
[InlineData(
"DebuggerTests.CheckSpecialCharactersInPath",
"dotnet://debugger-test-special-char-in-path.dll/test#.cs",
"dotnet://debugger-test-special-char-in-path.dll/test%23.cs",
"debugger-test-special-char-in-path-%23%40/test%23.cs")]
[InlineData(
"DebuggerTests.CheckSNonAsciiCharactersInPath",
Expand All @@ -972,7 +971,6 @@ public async Task SetBreakpointInProjectWithSpecialCharactersInPath(
string classWithNamespace, string expectedFileLocation, string expectedFileNameEscaped)
{
var bp = await SetBreakpointInMethod("debugger-test-special-char-in-path.dll", classWithNamespace, "Evaluate", 1);
var loc = bp.Value["locations"]?.Value<JArray>()[0];
var ret = await EvaluateAndCheck(
$"window.setTimeout(function() {{ invoke_static_method ('[debugger-test-special-char-in-path] {classWithNamespace}:Evaluate'); }}, 1);",
expectedFileLocation,
Expand Down