-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[debugger][wasm] Support DebuggerProxyAttribute #56872
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
Changes from 1 commit
7e985d2
33652d5
f56ef84
3a55e21
394e3f6
79e81ff
6c0abf2
19d6864
b1a32b5
3091b2f
de72265
a0a420e
31eff80
427b1f2
9d6b705
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,7 +88,7 @@ public async Task<JObject> TryToRunOnLoadedClasses(string varName, CancellationT | |
| classNameToFind += part.Trim(); | ||
| if (typeId != -1) | ||
| { | ||
| var fields = await proxy.SdbHelper.GetTypeFields(sessionId, typeId, false, token); | ||
| var fields = await proxy.SdbHelper.GetTypeFields(sessionId, typeId, onlyPublic: false, token); | ||
| foreach (var field in fields) | ||
| { | ||
| if (field.Name == part.Trim()) | ||
|
|
@@ -204,6 +204,7 @@ public async Task<JObject> Resolve(string varName, CancellationToken token) | |
| public async Task<JObject> Resolve(InvocationExpressionSyntax method, Dictionary<string, JObject> memberAccessValues, CancellationToken token) | ||
| { | ||
| var methodName = ""; | ||
| int isTryingLinq = 0; | ||
| try | ||
| { | ||
| JObject rootObject = null; | ||
|
|
@@ -223,18 +224,42 @@ public async Task<JObject> Resolve(InvocationExpressionSyntax method, Dictionary | |
| if (rootObject != null) | ||
| { | ||
| DotnetObjectId.TryParse(rootObject?["objectId"]?.Value<string>(), out DotnetObjectId objectId); | ||
| var typeId = await proxy.SdbHelper.GetTypeIdFromObject(sessionId, int.Parse(objectId.Value), true, token); | ||
| int methodId = await proxy.SdbHelper.GetMethodIdByName(sessionId, typeId[0], methodName, token); | ||
| var typeIds = await proxy.SdbHelper.GetTypeIdFromObject(sessionId, int.Parse(objectId.Value), true, token); | ||
| int methodId = await proxy.SdbHelper.GetMethodIdByName(sessionId, typeIds[0], methodName, token); | ||
| var className = await proxy.SdbHelper.GetTypeNameOriginal(sessionId, typeIds[0], token); | ||
| if (methodId == 0) //try to search on System.Linq.Enumerable | ||
radical marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| var linqTypeId = await proxy.SdbHelper.GetTypeByName(sessionId, "System.Linq.Enumerable", token); | ||
|
||
| var linqInitialize = await proxy.SdbHelper.TypeInitialize(sessionId, linqTypeId, token); | ||
| Console.WriteLine($"linqInitialize - {linqInitialize}"); | ||
|
||
| methodId = await proxy.SdbHelper.GetMethodIdByName(sessionId, linqTypeId, methodName, token); | ||
| if (methodId != 0) | ||
| { | ||
| foreach (var typeId in typeIds) | ||
| { | ||
| var genericTypes = await proxy.SdbHelper.GetGenericTypesFromType(sessionId, typeId, token); | ||
radical marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (genericTypes.Count > 0) | ||
| { | ||
| isTryingLinq = 1; | ||
| methodId = await proxy.SdbHelper.MakeGenericMethod(sessionId, methodId, genericTypes, token); | ||
| break; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (methodId == 0) { | ||
| var typeName = await proxy.SdbHelper.GetTypeName(sessionId, typeId[0], token); | ||
| var typeName = await proxy.SdbHelper.GetTypeName(sessionId, typeIds[0], token); | ||
| throw new Exception($"Method '{methodName}' not found in type '{typeName}'"); | ||
| } | ||
| var commandParamsObj = new MemoryStream(); | ||
| var commandParamsObjWriter = new MonoBinaryWriter(commandParamsObj); | ||
| commandParamsObjWriter.WriteObj(objectId, proxy.SdbHelper); | ||
| if (isTryingLinq == 0) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this writing? |
||
| commandParamsObjWriter.WriteObj(objectId, proxy.SdbHelper); | ||
| if (method.ArgumentList != null) | ||
| { | ||
| commandParamsObjWriter.Write((int)method.ArgumentList.Arguments.Count); | ||
| commandParamsObjWriter.Write((int)method.ArgumentList.Arguments.Count + isTryingLinq); | ||
| if (isTryingLinq == 1) | ||
| commandParamsObjWriter.WriteObj(objectId, proxy.SdbHelper); | ||
radical marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| foreach (var arg in method.ArgumentList.Arguments) | ||
| { | ||
| if (arg.Expression is LiteralExpressionSyntax) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests needed for this