Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <mabaul@microsoft.com>2020-01-28 20:31:50 +0300
committerGitHub <noreply@github.com>2020-01-28 20:31:50 +0300
commit7d2924adcb0df8a6aef59f06f60ad55eabe1f715 (patch)
tree71cf290b80357262cb9162c68d078983b1b6f967
parente2b632e4a707e2b62a2b3c95f21a208266a14925 (diff)
[wasm][debugger-proxy]: If we cannot load a PDB file, send a log entry. (#18601)
-rw-r--r--sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs17
-rw-r--r--sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs3
2 files changed, 18 insertions, 2 deletions
diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs
index 741a6792bd3..f1b1bebc00b 100644
--- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs
+++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs
@@ -9,6 +9,7 @@ using System.Net.Http;
using Mono.Cecil.Pdb;
using Newtonsoft.Json;
using System.Text.RegularExpressions;
+using System.Threading;
namespace WsProxy {
internal class BreakPointRequest {
@@ -493,9 +494,15 @@ namespace WsProxy {
}
internal class DebugStore {
+ MonoProxy proxy;
List<AssemblyInfo> assemblies = new List<AssemblyInfo> ();
- public DebugStore (string [] loaded_files)
+ public DebugStore (MonoProxy proxy)
+ {
+ this.proxy = proxy;
+ }
+
+ internal void Initialize (string[] loaded_files, CancellationToken token)
{
bool MatchPdb (string asm, string pdb)
{
@@ -525,6 +532,14 @@ namespace WsProxy {
this.assemblies.Add (new AssemblyInfo (assembly_bytes, pdb_bytes));
} catch (Exception e) {
Console.WriteLine ($"Failed to read {p} ({e.Message})");
+ var o = JObject.FromObject (new {
+ entry = new {
+ source = "other",
+ level = "warning",
+ text = $"Failed to read {p} ({e.Message})"
+ }
+ });
+ proxy.SendEvent ("Log.entryAdded", o, token);
}
}
}
diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs
index f7e4adf44ce..86f104f9c54 100644
--- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs
+++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs
@@ -578,7 +578,8 @@ namespace WsProxy {
var loaded_pdbs = await SendCommand ("Runtime.evaluate", o, token);
var the_value = loaded_pdbs.Value? ["result"]? ["value"];
var the_pdbs = the_value?.ToObject<string[]> ();
- this.store = new DebugStore (the_pdbs);
+ this.store = new DebugStore (this);
+ this.store.Initialize (the_pdbs, token);
foreach (var s in store.AllSources ()) {
var ok = JObject.FromObject (new {