Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Download Symbols from microsoft symbol server #40690

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
67075a6
Creating a draft to download symbols from microsoft symbol server whe…
thaystg Aug 12, 2020
45c6f81
Fix what lewing suggested.
thaystg Aug 14, 2020
34932d6
Changing what @radical suggested.
thaystg Aug 17, 2020
b94e6d5
Changed what @radical suggested.
thaystg Aug 25, 2020
4f29f82
Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
thaystg Aug 25, 2020
07cc6ca
Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
thaystg Aug 25, 2020
64c1ef9
If it's not available on a URL try in the next one in the list.
thaystg Aug 25, 2020
9792356
Merge branch 'thays_load_symbols_from_ms_symbol_server' of github.com…
thaystg Aug 25, 2020
b4f55d8
Logging error and adding comment about SDSR
thaystg Aug 25, 2020
9f41f60
Returning if we find the method even if we have an exception sending …
thaystg Aug 25, 2020
e8a13d3
Logging when we don't find the pdb.
thaystg Aug 25, 2020
b8c48e3
Changing what @radical suggested.
thaystg Aug 25, 2020
076eb42
Avoiding that we try to load symbols from the same assembly more than…
thaystg Aug 25, 2020
bdfc1c3
Simplifying and adding more log.
thaystg Aug 25, 2020
429907f
Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
thaystg Aug 26, 2020
7598ac9
Adding support for receive the urlSymbolServer as a parameter in the …
thaystg Sep 4, 2020
12f45c9
Merge remote-tracking branch 'upstream/master' into thays_load_symbol…
thaystg Sep 4, 2020
8b955aa
Fix @radical suggestion.
thaystg Sep 8, 2020
09729c4
Removing default symbol server URL, like this we can land this on rc …
thaystg Sep 14, 2020
b989c8e
Fix compilation.
thaystg Sep 14, 2020
2d5812e
Update src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs
thaystg Sep 15, 2020
d72fc69
Update src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
thaystg Sep 15, 2020
f9c93d2
Accepting @radical suggestion.
thaystg Sep 15, 2020
729887b
Adding workaround on dotnet/runtime while PR 686 is not merged on Cec…
thaystg Sep 15, 2020
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
10 changes: 9 additions & 1 deletion src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;

namespace Microsoft.WebAssembly.Diagnostics
{
Expand Down Expand Up @@ -138,7 +139,14 @@ async Task ConnectProxy(HttpContext context)
{
using var loggerFactory = LoggerFactory.Create(
builder => builder.AddConsole().AddFilter(null, LogLevel.Information));
var proxy = new DebuggerProxy(loggerFactory);

StringValues urlSymbolServerList;

if (!context.Request.Query.TryGetValue("urlSymbolServer", out urlSymbolServerList))
urlSymbolServerList += "http://msdl.microsoft.com/download/symbols";

var proxy = new DebuggerProxy(loggerFactory, urlSymbolServerList);

var ideSocket = await context.WebSockets.AcceptWebSocketAsync();

await proxy.Run(endpoint, ideSocket);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json.Linq;
using Microsoft.Extensions.Primitives;

namespace Microsoft.WebAssembly.Diagnostics
{
Expand Down Expand Up @@ -122,7 +123,10 @@ public async Task LaunchAndServe(ProcessStartInfo psi, HttpContext context, Func

using var loggerFactory = LoggerFactory.Create(
builder => builder.AddConsole().AddFilter(null, LogLevel.Information));
var proxy = new DebuggerProxy(loggerFactory);

StringValues urlSymbolServerList = new StringValues("http://msdl.microsoft.com/download/symbols");

var proxy = new DebuggerProxy(loggerFactory, urlSymbolServerList);
var browserUri = new Uri(con_str);
var ideSocket = await context.WebSockets.AcceptWebSocketAsync();

Expand Down
5 changes: 3 additions & 2 deletions src/mono/wasm/debugger/BrowserDebugProxy/DebuggerProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Net.WebSockets;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;

namespace Microsoft.WebAssembly.Diagnostics
{
Expand All @@ -16,9 +17,9 @@ public class DebuggerProxy
{
private readonly MonoProxy proxy;

public DebuggerProxy(ILoggerFactory loggerFactory)
public DebuggerProxy(ILoggerFactory loggerFactory, StringValues urlSymbolServerList)
radical marked this conversation as resolved.
Show resolved Hide resolved
{
proxy = new MonoProxy(loggerFactory);
proxy = new MonoProxy(loggerFactory, urlSymbolServerList);
}

public Task Run(Uri browserUri, WebSocket ideSocket)
Expand Down
11 changes: 6 additions & 5 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@
using Mono.Cecil.Pdb;
using Mono.Cecil;
using System.Net.Http;
using Microsoft.Extensions.Primitives;

namespace Microsoft.WebAssembly.Diagnostics
{

internal class MonoProxy : DevToolsProxy
{
List<string> urlSymbolServerList = new List<string> ();
StringValues urlSymbolServerList;
static HttpClient client = new HttpClient();
HashSet<SessionId> sessions = new HashSet<SessionId>();
Dictionary<SessionId, ExecutionContext> contexts = new Dictionary<SessionId, ExecutionContext>();

public MonoProxy(ILoggerFactory loggerFactory, bool hideWebDriver = true) : base(loggerFactory)
public MonoProxy(ILoggerFactory loggerFactory, StringValues urlSymbolServerList, bool hideWebDriver = true) : base(loggerFactory)
{
this.hideWebDriver = hideWebDriver;
urlSymbolServerList.Add("http://msdl.microsoft.com/download/symbols");
this.hideWebDriver = hideWebDriver;
this.urlSymbolServerList = urlSymbolServerList;
radical marked this conversation as resolved.
Show resolved Hide resolved
}

readonly bool hideWebDriver;
Expand Down Expand Up @@ -352,7 +353,7 @@ protected override async Task<bool> AcceptCommand(MessageId id, string method, J
{
string url = args["url"]?.Value<string>();
if (!String.IsNullOrEmpty(url) && !urlSymbolServerList.Contains(url))
urlSymbolServerList.Add(url);
urlSymbolServerList += url;
return true;
}
case "DotnetDebugger.getMethodLocation":
Expand Down